mirror of
https://github.com/harness/drone.git
synced 2025-05-05 23:42:57 +00:00
feat: [CODE-3546] update allowed states on LFS APIs for migrating repos (#3707)
This commit is contained in:
parent
0db23cc023
commit
af75e56eb6
@ -37,7 +37,9 @@ func (c *Controller) LFSTransfer(ctx context.Context,
|
|||||||
reqPermission = enum.PermissionRepoPush
|
reqPermission = enum.PermissionRepoPush
|
||||||
}
|
}
|
||||||
|
|
||||||
repo, err := c.getRepoCheckAccessAndSetting(ctx, session, repoRef, reqPermission)
|
var additionalAllowedRepoStates = []enum.RepoState{enum.RepoStateMigrateGitPush}
|
||||||
|
repo, err := c.getRepoCheckAccessAndSetting(ctx, session, repoRef,
|
||||||
|
reqPermission, additionalAllowedRepoStates...)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
@ -39,7 +39,9 @@ func (c *Controller) Upload(ctx context.Context,
|
|||||||
pointer Pointer,
|
pointer Pointer,
|
||||||
file io.Reader,
|
file io.Reader,
|
||||||
) (*UploadOut, error) {
|
) (*UploadOut, error) {
|
||||||
repo, err := c.getRepoCheckAccessAndSetting(ctx, session, repoRef, enum.PermissionRepoPush)
|
var additionalAllowedRepoStates = []enum.RepoState{enum.RepoStateMigrateGitPush}
|
||||||
|
repo, err := c.getRepoCheckAccessAndSetting(ctx, session, repoRef,
|
||||||
|
enum.PermissionRepoPush, additionalAllowedRepoStates...)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("failed to acquire access to repo: %w", err)
|
return nil, fmt.Errorf("failed to acquire access to repo: %w", err)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user