{"record":{"id":"879788ef1af0abf0","repo":"goharbor/harbor","slug":"forbidden","errorCode":"FORBIDDEN","errorMessage":"only admins(system and project) can access permissions","messagePattern":"only admins\\(system and project\\) can access permissions","errorType":"error_code","errorClass":"*errors.Error","httpStatus":403,"severity":"error","filePath":"src/server/v2.0/handler/permissions.go","lineNumber":71,"sourceCode":"\tif !isSystemAdmin && !isProjectAdmin {\n\t\treturn p.SendError(ctx, errors.ForbiddenError(errors.New(\"only admins(system and project) can access permissions\")))\n\t}\n\n\tprovider := rbac.GetPermissionProvider()\n\tsysPermissions := make([]*types.Policy, 0)","sourceCodeStart":53,"sourceCodeEnd":89,"githubUrl":"https://github.com/goharbor/harbor/blob/7b2fd08cc568955cca339afeefab27372840d936/src/server/v2.0/handler/permissions.go#L53-L89","documentation":"Authorization guard in GetPermissions: the endpoint returns RBAC permission catalogs only to system admins or project admins. It fires when the caller's security context is neither, as a ForbiddenError — a deliberate privilege check, not a malfunction.","triggerScenarios":"Thrown at src/server/v2.0/handler/permissions.go:71 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Log in with a system admin account or a project admin robot/user","Grant the user project admin role in the relevant project","Request only resources your role is entitled to read"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"7b2fd08cc568955cca339afeefab27372840d936","analyzedAt":"2026-08-16T00:00:10.961Z","contentChangedAt":"2026-08-16T00:00:10.961Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}