Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ACL ¶
type ACL struct {
// contains filtered or unexported fields
}
ACL
func (*ACL) IsRoleAllowed ¶
check whethher role has permission by scoped and permission
func (*ACL) IsRoleAllowedUniquely ¶
check whethher role has permission by unique permission
func (*ACL) RemRoleByID ¶
remove one or more ACRole by IDs
type ACRole ¶
ACRole is a model which has mutiple ACScopes It typically stands for for "Position in componay" or "User group"
func NewRoleWithUniquePermissions ¶
This is a quick method to create role with unique permissions, which means each permission identifier is unique for sure in your system, such as route path. And there is no permission scope in your access structure so we can ignore it with this function
func (*ACRole) IsAllowed ¶
Check whether role has a scoped permission. The permissions may be not unique, thus scopeID should be provided
func (*ACRole) IsAllowedUniquely ¶
Check whether role has a unique permission. Use this function while every permission is unique, even if scope exists
func (*ACRole) RemScopeByID ¶
Remove one or more Scopes from user group
type ACScope ¶
ACScope is a combination of permissions, it is the minium unit to classify permissions in application It stands for "actions group"
func (*ACScope) AddPermission ¶
add one or more permissions
func (*ACScope) RemPermission ¶
remove one or more permissions