feat: add roles permission schema.

This commit is contained in:
elforjani13
2021-11-21 18:21:10 +02:00
parent ddbadb67c8
commit 955ae97c19
3 changed files with 12 additions and 13 deletions

View File

@@ -1,12 +1,11 @@
export const mapperPermissionSchema = (data) => {
return [data].map(({ permissions }) =>
Object.keys(permissions).map((item) => {
const [value, key] = item.split('/');
return {
subject: value,
ability: key,
value: permissions[item],
};
}),
);
export const mapperPermissionSchema = ({ permissions }) => {
return Object.keys(permissions).map((index) => {
const [value, key] = index.split('/');
return {
subject: value,
ability: key,
value: permissions[index],
};
});
};