Documentation ¶
Overview ¶
package accesstypes provides types for permissions, roles, and domains types for the access package
Index ¶
- Constants
- type Domain
- type Enforcer
- type Field
- type Permission
- type PermissionDetail
- type PermissionScope
- type ResolvedPermissions
- type ResolvedResourcePermissions
- type ResolvedTagPermissions
- type Resource
- type Role
- type RoleCollection
- type RolePermissionCollection
- type Tag
- type TagPermissions
- type User
- type UserPermissionCollection
Constants ¶
View Source
const GlobalDomain = Domain("global")
GlobalDomain is the domain used when a permission is applied at the Global level instead of to a specific domain.
View Source
const GlobalResource = Resource("global")
GlobalResource is the resource used when a permission is applied to the entire application, (i.e. Global level) instead of to a specific resource.
View Source
const NoopUser = "noop"
NoopUser is the user assigned to an empty role in casbin to ensure the role can be enumerated if no one else is assigned
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Permission ¶
type Permission string
const ( NullPermission Permission = "" Create Permission = "Create" Read Permission = "Read" List Permission = "List" Update Permission = "Update" Delete Permission = "Delete" )
func UnmarshalPermission ¶
func UnmarshalPermission(permission string) Permission
func (Permission) Marshal ¶
func (p Permission) Marshal() string
type PermissionDetail ¶
type PermissionDetail struct { Description string Scope PermissionScope }
type PermissionScope ¶
type PermissionScope string
const ( GlobalPermissionScope PermissionScope = "global" DomainPermissionScope PermissionScope = "domain" )
type ResolvedPermissions ¶ added in v0.2.5
type ResolvedPermissions struct { Resources ResolvedResourcePermissions Tags ResolvedTagPermissions }
type ResolvedResourcePermissions ¶ added in v0.2.5
type ResolvedResourcePermissions map[Domain]map[Resource]map[Permission]bool
type ResolvedTagPermissions ¶ added in v0.3.0
type ResolvedTagPermissions map[Domain]map[Resource]map[Tag]map[Permission]bool
type Resource ¶
type Resource string
func UnmarshalResource ¶
func (Resource) ResourceAndTag ¶ added in v0.3.0
func (Resource) ResourceWithTag ¶ added in v0.3.0
type RoleCollection ¶
type RolePermissionCollection ¶
type RolePermissionCollection map[Permission][]Resource
type TagPermissions ¶ added in v0.5.0
type TagPermissions map[Tag][]Permission
type User ¶
type User string
User represents a user in the authorization system
func UnmarshalUser ¶
type UserPermissionCollection ¶
type UserPermissionCollection map[Domain]map[Resource][]Permission
Click to show internal directories.
Click to hide internal directories.