- useRoles(): {
bannedRoleId: Ref<string>;
createRole: ((name: string, description: string, allowedPermissions: Permission[], disallowedPermissions: Permission[]) => Promise<void>);
grantMasterRole: ((to: string) => Promise<void>);
grantRoles: ((to: string, roles: string[]) => Promise<void>);
loadRoles: (() => Promise<void>);
masterRoleId: Ref<string>;
removeRolePermission: ((id: string, permission: Permission, isAllowed: boolean) => Promise<void>);
revokeRoles: ((from: string, roles: string[]) => Promise<void>);
roles: ComputedRef<FlattenRole[]>;
rolesWithResources: Ref<{
__typename?: "Role";
description: string;
id: string;
resources: ({ __typename?: "Resource" | undefined; id: string; name: string; allows: string[]; disallows: string[]; })[];
}[]>;
updateRole: ((id: string, name: string, description: string, allowedPermissions: Permission[], disallowedPermissions: Permission[], newAllowedPermissions: Permission[], newDisallowedPermissions: Permission[]) => Promise<void>);
}
-
Returns {
bannedRoleId: Ref<string>;
createRole: ((name: string, description: string, allowedPermissions: Permission[], disallowedPermissions: Permission[]) => Promise<void>);
grantMasterRole: ((to: string) => Promise<void>);
grantRoles: ((to: string, roles: string[]) => Promise<void>);
loadRoles: (() => Promise<void>);
masterRoleId: Ref<string>;
removeRolePermission: ((id: string, permission: Permission, isAllowed: boolean) => Promise<void>);
revokeRoles: ((from: string, roles: string[]) => Promise<void>);
roles: ComputedRef<FlattenRole[]>;
rolesWithResources: Ref<{
__typename?: "Role";
description: string;
id: string;
resources: ({ __typename?: "Resource" | undefined; id: string; name: string; allows: string[]; disallows: string[]; })[];
}[]>;
updateRole: ((id: string, name: string, description: string, allowedPermissions: Permission[], disallowedPermissions: Permission[], newAllowedPermissions: Permission[], newDisallowedPermissions: Permission[]) => Promise<void>);
}
-
bannedRoleId: Ref<string>
-
createRole: ((name: string, description: string, allowedPermissions: Permission[], disallowedPermissions: Permission[]) => Promise<void>)
-
- (name: string, description: string, allowedPermissions: Permission[], disallowedPermissions: Permission[]): Promise<void>
-
Parameters
-
name: string
-
description: string
-
allowedPermissions: Permission[]
-
disallowedPermissions: Permission[]
Returns Promise<void>
-
grantMasterRole: ((to: string) => Promise<void>)
-
- (to: string): Promise<void>
-
Returns Promise<void>
-
grantRoles: ((to: string, roles: string[]) => Promise<void>)
-
- (to: string, roles: string[]): Promise<void>
-
Parameters
-
to: string
-
roles: string[]
Returns Promise<void>
-
loadRoles: (() => Promise<void>)
-
- (): Promise<void>
-
Returns Promise<void>
-
masterRoleId: Ref<string>
-
removeRolePermission: ((id: string, permission: Permission, isAllowed: boolean) => Promise<void>)
-
- (id: string, permission: Permission, isAllowed: boolean): Promise<void>
-
Parameters
-
id: string
-
-
isAllowed: boolean
Returns Promise<void>
-
revokeRoles: ((from: string, roles: string[]) => Promise<void>)
-
- (from: string, roles: string[]): Promise<void>
-
Parameters
-
from: string
-
roles: string[]
Returns Promise<void>
-
-
rolesWithResources: Ref<{
__typename?: "Role";
description: string;
id: string;
resources: ({ __typename?: "Resource" | undefined; id: string; name: string; allows: string[]; disallows: string[]; })[];
}[]>
-
updateRole: ((id: string, name: string, description: string, allowedPermissions: Permission[], disallowedPermissions: Permission[], newAllowedPermissions: Permission[], newDisallowedPermissions: Permission[]) => Promise<void>)
-
- (id: string, name: string, description: string, allowedPermissions: Permission[], disallowedPermissions: Permission[], newAllowedPermissions: Permission[], newDisallowedPermissions: Permission[]): Promise<void>
-
Returns Promise<void>