@mikezimm/fps-core-v7
Version:
Library of reusable core interfaces, types and constants migrated from fps-library-v2
27 lines • 927 B
JavaScript
/**
* 2025-01-04: Migrated from PivotTiles/Permissions
*
* @param myPermissions
* @returns
*/
export function createComparePermissions(myPermissions) {
const sortedPermissions = myPermissions.sortedPermissions;
const comparePermissions = [];
sortedPermissions.map(user => {
//Loop through this user's permissions and get highest level
const userCompare = {
highPriority: user.highPriority,
permNames: [],
userId: user.userId,
};
user.permissions.map(userPerm => {
//Add highest level to the user
userCompare.permNames.push(userPerm.Name);
});
//Push User info to Sorted Users group
comparePermissions.push(userCompare);
});
myPermissions.comparePermissions = comparePermissions;
return myPermissions;
}
//# sourceMappingURL=createComparePermissions.js.map