mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-17 13:20:31 +00:00
feat: add roles permission schema.
This commit is contained in:
@@ -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],
|
||||
};
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user