mirror of
https://github.com/goharbor/harbor.git
synced 2025-01-14 03:31:27 +01:00
Merge pull request #15238 from chlins/fix/create-p2p-policy-permission
fix(p2p): fix p2p create policy permission
This commit is contained in:
commit
4ddaecdc3f
@ -237,6 +237,13 @@ func (api *preheatAPI) CreatePolicy(ctx context.Context, params operation.Create
|
||||
return api.SendError(ctx, err)
|
||||
}
|
||||
|
||||
project, err := api.projectCtl.GetByName(ctx, params.ProjectName)
|
||||
if err != nil {
|
||||
return api.SendError(ctx, err)
|
||||
}
|
||||
// override project ID
|
||||
policy.ProjectID = project.ProjectID
|
||||
|
||||
_, err = api.preheatCtl.CreatePolicy(ctx, policy)
|
||||
if err != nil {
|
||||
return api.SendError(ctx, err)
|
||||
|
Loading…
Reference in New Issue
Block a user