useRoleDefinition

useRoleDefinition(
	roleDefId: string | number,
	options?: RoleDefinitionOptions,
	deps?: any[]): IRoleDefinitionInfo | null | undefined;

Returns role definition with the specified identifier.

Examples

Get role definition,

const roleDefById = useRoleDefinition(1073741826);

const roleDefByName = useRoleDefinition("Contribute");

const roleDefByKind = useRoleDefinition({
	roleType: RoleTypeKind.EditListItems | RoleTypeKind.ManageLists
});

Query role definition properties,

const roleDef = useRoleDefinition({ roleType: RoleTypeKind.EditListItems }, {
	query: {
		select: ["Id", "Name", "Description", "Order"]
	}
});

Parameters

NameTypeDescriptionTracked for changes
roleDefIdstring | numberRole definition name, Id or RoleTypeKindYes
options?WebAppsOptionsuseRoleDefinition hook optionsPartially
deps?DependencyListHook dependency list.Yes