Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // Mgr is a global role permission/rbac policy manager instance Mgr = NewManager() )
Functions ¶
This section is empty.
Types ¶
type Manager ¶
type Manager interface { // CreatePermission ... CreatePermission(ctx context.Context, rp *model.RolePermission) (int64, error) // DeletePermission ... DeletePermission(ctx context.Context, id int64) error // ListPermissions list role permissions according to the query. ListPermissions(ctx context.Context, query *q.Query) ([]*model.RolePermission, error) // DeletePermissionsByRole get permissions by role type and id DeletePermissionsByRole(ctx context.Context, roleType string, roleID int64) error // CreateRbacPolicy ... CreateRbacPolicy(ctx context.Context, pp *model.PermissionPolicy) (int64, error) // DeleteRbacPolicy ... DeleteRbacPolicy(ctx context.Context, id int64) error // ListRbacPolicies list PermissionPolicy according to the query. ListRbacPolicies(ctx context.Context, query *q.Query) ([]*model.PermissionPolicy, error) // GetPermissionsByRole ... GetPermissionsByRole(ctx context.Context, roleType string, roleID int64) ([]*model.UniversalRolePermission, error) }
Manager is the interface of role permission and rbac policy
Click to show internal directories.
Click to hide internal directories.