Documentation
¶
Index ¶
- Constants
- Variables
- func HasPermission(ctx context.Context, permissions ...string) bool
- func HaveAccessApprove(ctx context.Context, obj any) bool
- func HaveAccessCount(ctx context.Context, obj any) bool
- func HaveAccessCreate(ctx context.Context, obj any) bool
- func HaveAccessDelete(ctx context.Context, obj any) bool
- func HaveAccessGet(ctx context.Context, obj any) bool
- func HaveAccessList(ctx context.Context, obj any) bool
- func HaveAccessPause(ctx context.Context, obj any) bool
- func HaveAccessReject(ctx context.Context, obj any) bool
- func HaveAccessRun(ctx context.Context, obj any) bool
- func HaveAccessSet(ctx context.Context, obj any) bool
- func HaveAccessUpdate(ctx context.Context, obj any) bool
- func HaveAccessView(ctx context.Context, obj any) bool
- func HaveAccountLink(ctx context.Context, obj any) bool
- func HaveObjectPermissions(ctx context.Context, obj any, permissions ...string) bool
- func HavePermissions(ctx context.Context, permissions ...string) bool
- func InitModelPermissions(pm *permissions.Manager, models ...any)
- func InitModelPermissionsWithCustomCheck(pm *permissions.Manager, customCheck checkFnk, models ...any)
- func IsNoPermCheck(ctx context.Context) bool
- func WithNoPermCheck(ctx context.Context) context.Context
- type ACLError
- type RBACType
Constants ¶
const ( PermView = acl.PermView PermCreate = acl.PermCreate PermUpdate = acl.PermUpdate PermDelete = acl.PermDelete PermList = acl.PermList PermAuthCross = acl.PermAuthCross PermCount = acl.PermCount PermApprove = acl.PermApprove PermReject = acl.PermReject PermGet = acl.PermGet PermSet = acl.PermSet PermRun = `run` PermPause = `pause` )
The permission list
Variables ¶
var ErrNoPermissions = acl.ErrNoPermissions
Functions ¶
func HasPermission ¶
HasPermission returns `true` if the `user` have all permissions from the list (without custom check)
func HaveAccessApprove ¶
HaveAccessApprove of the object returns `true` if user can approve the object
func HaveAccessCount ¶
HaveAccessCount of the object returns `true` if user can count the object
func HaveAccessCreate ¶
HaveAccessCreate of the object returns `true` if user can create this type of object
func HaveAccessDelete ¶
HaveAccessDelete of the object returns `true` if user can delite the object
func HaveAccessGet ¶
HaveAccessGet of the object returns `true` if user can get the object
func HaveAccessList ¶
HaveAccessList to the object returns `true` if user can read list of the object
func HaveAccessPause ¶
HaveAccessPause of the object returns `true` if user can pause the object
func HaveAccessReject ¶
HaveAccessReject of the object returns `true` if user can reject the object
func HaveAccessRun ¶
HaveAccessRun of the object returns `true` if user can run the object
func HaveAccessSet ¶
HaveAccessSet of the object returns `true` if user can set the object
func HaveAccessUpdate ¶
HaveAccessUpdate of the object returns `true` if user can update the object
func HaveAccessView ¶
HaveAccessView to the object returns `true` if user can read of the object
func HaveAccountLink ¶
HaveAccountLink of the object to the current account
func HaveObjectPermissions ¶
HaveObjectPermissions returns `true` if the `user` have all permissions from the list for the object
func HavePermissions ¶
HavePermissions returns `true` if the `user` have all permissions from the list
func InitModelPermissions ¶
func InitModelPermissions(pm *permissions.Manager, models ...any)
InitModelPermissions for particular models
func InitModelPermissionsWithCustomCheck ¶
func InitModelPermissionsWithCustomCheck(pm *permissions.Manager, customCheck checkFnk, models ...any)
InitModelPermissionsWithCustomCheck for particular models and extra custom check function
func IsNoPermCheck ¶
IsNoPermCheck returns `true` if the permission check is disabled