Skip to content

Commit 783b3a6

Browse files
committed
style: add ts doc to buildPermissionsByRoleMatrix function
1 parent 914d4b6 commit 783b3a6

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

  • src/authz-module/libraries-manager

src/authz-module/libraries-manager/utils.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,18 @@
11
import { actionKeys } from '@src/authz-module/components/RoleCard/constants';
22
import actionMessages from '../components/RoleCard/messages';
33

4+
/**
5+
* Builds a permission matrix for a role.
6+
*
7+
* Builds a permission matrix grouped by resource, mapping each action to its display label
8+
* and enabled/disabled state based on the role's allowed permissions.
9+
*
10+
* @param rolePermissions - Array of permission keys allowed for the current role.
11+
* @param permissions - Permissions metadata.
12+
* @param resources - Resources metadata.
13+
* @param intl - the i18n function to enable label translations.
14+
* @returns An array of permission groupings by resource with action-level details.
15+
*/
416
const buildPermissionsByRoleMatrix = ({
517
rolePermissions, permissions, resources, intl,
618
}) => {

0 commit comments

Comments
 (0)