mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-17 13:20:31 +00:00
13 lines
300 B
JavaScript
13 lines
300 B
JavaScript
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],
|
|
};
|
|
}),
|
|
);
|
|
};
|