Documentation
¶
Overview ¶
Package model defines the core SFBAC domain types shared across layers.
Index ¶
Constants ¶
View Source
const ( MetaRoleRead = "role:read" MetaRoleWrite = "role:write" MetaRoleAssign = "role:assign" MetaOperationRead = "operation:read" MetaOperationWrite = "operation:write" MetaOperationAssign = "operation:assign" MetaResourceRead = "resource:read" MetaResourceWrite = "resource:write" MetaUserRead = "user:read" )
Meta operation names used to authorize Sforza's own administrative APIs.
View Source
const AdminRole = "authorization:admin"
AdminRole is the bootstrap administrator role created in every tenant.
Variables ¶
View Source
var MetaOperations = map[string]string{ MetaRoleRead: "role", MetaRoleWrite: "role", MetaRoleAssign: "role", MetaOperationRead: "operation", MetaOperationWrite: "operation", MetaOperationAssign: "operation", MetaResourceRead: "resource", MetaResourceWrite: "resource", MetaUserRead: "user", }
MetaOperations maps every meta operation to its meta resource.
Functions ¶
func IsMetaOperation ¶
IsMetaOperation reports whether the operation belongs to Sforza's own meta authorization model.
func OperationResource ¶
OperationResource extracts the resource part of an operation name ("product:read" -> "product"). It returns "" when the name has no "resource:action" shape.
Types ¶
type OperationScope ¶
OperationScope is the effective (operation, scope) pair returned by permission queries.
Click to show internal directories.
Click to hide internal directories.