Documentation
¶
Index ¶
Constants ¶
View Source
const ( PE string = "pe" Owner string = "owner" Maintainer string = "maintainer" Guest string = "guest" )
Variables ¶
View Source
var ( ErrorRoleNotFound = errors.New("role not found") ErrorLoadCheckError = errors.New("load check error") )
Functions ¶
func CheckRoleIfValid ¶
Types ¶
type CompResult ¶
type CompResult uint8
const ( RoleEqual CompResult = iota RoleBigger RoleSmaller RoleCanNotCompare )
type Service ¶
type Service interface { // ListRole Lists all the role ListRole(ctx context.Context) ([]types.Role, error) // GetRole get role by the role name GetRole(ctx context.Context, roleName string) (*types.Role, error) // RoleCompare compare if the role1's permission is higher than role2 RoleCompare(ctx context.Context, role1, role2 string) (CompResult, error) // GetDefaultRole return the default role(no default role will return nil) GetDefaultRole(ctx context.Context) *types.Role }
func NewFileRoleFrom2 ¶
Click to show internal directories.
Click to hide internal directories.