mirror of
https://github.com/goharbor/harbor
synced 2024-09-21 06:45:37 +00:00
fix: handle project not found when creating token
Closes #14242 Signed-off-by: He Weiwei <hweiwei@vmware.com>
This commit is contained in:
parent
582476647c
commit
1601c70278
|
@ -173,6 +173,12 @@ func (rep repositoryFilter) filter(ctx security.Context, pm promgr.ProjectManage
|
|||
return err
|
||||
}
|
||||
|
||||
if project == nil {
|
||||
log.Debugf("project %s does not exist, set empty permission", projectName)
|
||||
a.Actions = []string{}
|
||||
return nil
|
||||
}
|
||||
|
||||
resource := rbac.NewProjectNamespace(project.ProjectID).Resource(rbac.ResourceRepository)
|
||||
scopeList := make([]string, 0)
|
||||
for s := range resourceScopes(ctx, resource) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user