@@ -11,8 +11,8 @@ import (
1111
1212 auth_model "code.gitea.io/gitea/models/auth"
1313 git_model "code.gitea.io/gitea/models/git"
14+ access_model "code.gitea.io/gitea/models/perm/access"
1415 repo_model "code.gitea.io/gitea/models/repo"
15- user_model "code.gitea.io/gitea/models/user"
1616 "code.gitea.io/gitea/modules/json"
1717 lfs_module "code.gitea.io/gitea/modules/lfs"
1818 "code.gitea.io/gitea/modules/log"
@@ -179,9 +179,9 @@ func PostLockHandler(ctx *context.Context) {
179179
180180 var lockCtx go_context.Context = ctx
181181 // Pass Actions Task ID in context if creating lock using Actions Job Token
182- if ctx .Doer != nil && ctx . Doer . ID == user_model . ActionsUserID {
182+ if ctx .Data [ "IsActionsToken" ] == true {
183183 taskID := ctx .Data ["ActionsTaskID" ].(int64 )
184- lockCtx = go_context .WithValue (lockCtx , user_model . ActionsUserName , taskID )
184+ lockCtx = go_context .WithValue (lockCtx , access_model . ActionsTaskIDKey , taskID )
185185 }
186186
187187 lock , err := git_model .CreateLFSLock (lockCtx , repository , & git_model.LFSLock {
@@ -326,9 +326,9 @@ func UnLockHandler(ctx *context.Context) {
326326
327327 var lockCtx go_context.Context = ctx
328328 // Pass Actions Task ID in context if deleting lock using Actions Job Token
329- if ctx .Doer != nil && ctx . Doer . ID == user_model . ActionsUserID {
329+ if ctx .Data [ "IsActionsToken" ] == true {
330330 taskID := ctx .Data ["ActionsTaskID" ].(int64 )
331- lockCtx = go_context .WithValue (lockCtx , user_model . ActionsUserName , taskID )
331+ lockCtx = go_context .WithValue (lockCtx , access_model . ActionsTaskIDKey , taskID )
332332 }
333333
334334 lock , err := git_model .DeleteLFSLockByID (lockCtx , ctx .PathParamInt64 ("lid" ), repository , ctx .Doer , req .Force )
0 commit comments