goharbor/harbor · error · *errors.Error

FORBIDDEN

FORBIDDEN

Error message

only admins(system and project) can access permissions

What it means

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.

Solutions

  1. Log in with a system admin account or a project admin robot/user
  2. Grant the user project admin role in the relevant project
  3. Request only resources your role is entitled to read
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at src/server/v2.0/handler/permissions.go:71 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of goharbor/harbor@7b2fd08cc5 (2026-08-16). Data as JSON: /api/errors/879788ef1af0abf0. Report an issue: GitHub.

Appendix: source

Thrown at src/server/v2.0/handler/permissions.go:71

	if !isSystemAdmin && !isProjectAdmin {
		return p.SendError(ctx, errors.ForbiddenError(errors.New("only admins(system and project) can access permissions")))
	}

	provider := rbac.GetPermissionProvider()
	sysPermissions := make([]*types.Policy, 0)

View on GitHub (pinned to 7b2fd08cc5)