mirror of
https://github.com/goharbor/harbor.git
synced 2024-12-27 02:58:05 +01:00
fix(p2p): fix p2p create policy permission
Signed-off-by: chlins <chlins.zhang@gmail.com>
This commit is contained in:
parent
4e1f6633af
commit
f1456558db
@ -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