Documentation
¶
Index ¶
Constants ¶
View Source
const ( // PublicGuard marks a generated page or route as intentionally public. PublicGuard = "public" // RoleGuardPrefix marks a native RBAC guard that requires a principal role. RoleGuardPrefix = "role:" // PermissionGuardPrefix marks a native RBAC guard that requires a principal permission. PermissionGuardPrefix = "permission:" )
Variables ¶
View Source
var ( // ErrUnauthenticated reports that a native RBAC guard has no principal. ErrUnauthenticated = errors.New("gowdk principal is unauthenticated") // ErrForbidden reports that a native RBAC guard rejected the principal. ErrForbidden = errors.New("gowdk principal is forbidden") )
Functions ¶
func IsNativeGuard ¶
IsNativeGuard reports whether name is a built-in role or permission guard.
func IsPublicGuard ¶
IsPublicGuard reports whether name is the explicit public access marker.
Types ¶
type Principal ¶
Principal is the current application-owned identity visible to native RBAC guards. GOWDK does not own users, sessions, OAuth, tenants, or persistence.
func (Principal) HasPermission ¶
HasPermission reports whether the principal has permission.
Click to show internal directories.
Click to hide internal directories.