Skip to content

Commit

Permalink
feat: see why you have system perms on user direclty #441
Browse files Browse the repository at this point in the history
  • Loading branch information
VinceFINET committed Sep 12, 2024
1 parent 7e9195a commit cd74665
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,19 @@ export class OrgCheckRecipeActiveUsers extends OrgCheckRecipe {
await OrgCheckProcessor.filtre(user.permissionSetIds, (id) => permissionSets.has(id)),
(id) => permissionSets.get(id)
);
user.aggregateImportantPermissions = user.profileRef?.importantPermissions || {};
user.aggregateImportantPermissions = {};
if (user.profileRef?.importantPermissions) {
Object.keys(user.profileRef.importantPermissions)
.filter(permName => user.profileRef.importantPermissions[permName] === true)
.forEach(permName => { user.aggregateImportantPermissions[permName] = [ user.profileRef ]; });
}
await OrgCheckProcessor.chaque(user.permissionSetRefs, (permissionSet) => {
Object.keys(permissionSet.importantPermissions)
.filter(permName => permissionSet.importantPermissions[permName] === true)
.forEach(permName => { user.aggregateImportantPermissions[permName] = true; });
.forEach(permName => {
if (!user.aggregateImportantPermissions[permName]) user.aggregateImportantPermissions[permName] = [];
user.aggregateImportantPermissions[permName].push(permissionSet);
});
});
});
// Return all data
Expand Down
29 changes: 16 additions & 13 deletions force-app/main/default/lwc/orgcheckApp/orgcheckApp.js
Original file line number Diff line number Diff line change
Expand Up @@ -660,20 +660,23 @@ export default class OrgCheckApp extends LightningElement {
queuesTableData;

usersTableColumns = [
{ label: 'Score', type: 'score', data: { value: 'score', id: 'id', name: 'name' }, sorted: 'desc' },
{ label: 'User Name', type: 'id', data: { value: 'name', url: 'url' }},
{ label: 'Under LEX?', type: 'boolean', data: { value: 'onLightningExperience' }},
{ label: 'Last login', type: 'dateTime', data: { value: 'lastLogin' }, modifier: { valueIfEmpty: 'Never logged!' }},
{ label: 'Failed logins', type: 'numeric', data: { value: 'numberFailedLogins' }},
{ label: 'Password change', type: 'dateTime', data: { value: 'lastPasswordChange' }},
{ label: 'Api Enabled', type: 'boolean', data: { ref: 'aggregateImportantPermissions', value: 'apiEnabled' }},
{ label: 'View Setup', type: 'boolean', data: { ref: 'aggregateImportantPermissions', value: 'viewSetup' }},
{ label: 'Modify All Data', type: 'boolean', data: { ref: 'aggregateImportantPermissions', value: 'modifyAllData' }},
{ label: 'View All Data', type: 'boolean', data: { ref: 'aggregateImportantPermissions', value: 'viewAllData' }},
{ label: 'Profile', type: 'id', data: { ref: 'profileRef', url: 'url', value: 'name' }},
{ label: 'Permission Sets', type: 'ids', data: { ref: 'permissionSetRefs', url: 'url', value: 'name' }}
{ label: 'Score', type: 'score', data: { value: 'score', id: 'id', name: 'name' }, sorted: 'desc' },
{ label: 'User Name', type: 'id', data: { value: 'name', url: 'url' }},
{ label: 'Under LEX?', type: 'boolean', data: { value: 'onLightningExperience' }},
{ label: 'Last login', type: 'dateTime', data: { value: 'lastLogin' }, modifier: { valueIfEmpty: 'Never logged!' }},
{ label: 'Failed logins', type: 'numeric', data: { value: 'numberFailedLogins' }},
{ label: 'Password change', type: 'dateTime', data: { value: 'lastPasswordChange' }},
{ label: 'Api Enabled', type: 'boolean', data: { ref: 'aggregateImportantPermissions.apiEnabled', value: 'length' }},
{ label: 'Api Enabled granted from', type: 'ids', data: { ref: 'aggregateImportantPermissions.apiEnabled', url: 'url', value: 'name' }},
{ label: 'View Setup', type: 'boolean', data: { ref: 'aggregateImportantPermissions.viewSetup', value: 'length' }},
{ label: 'View Setup granted from', type: 'ids', data: { ref: 'aggregateImportantPermissions.viewSetup', url: 'url', value: 'name' }},
{ label: 'Modify All Data', type: 'boolean', data: { ref: 'aggregateImportantPermissions.modifyAllData', value: 'length' }},
{ label: 'Modify All Data granted from', type: 'ids', data: { ref: 'aggregateImportantPermissions.modifyAllData', url: 'url', value: 'name' }},
{ label: 'View All Data', type: 'boolean', data: { ref: 'aggregateImportantPermissions.viewAllData', value: 'length' }},
{ label: 'View All Data granted from', type: 'ids', data: { ref: 'aggregateImportantPermissions.viewAllData', url: 'url', value: 'name' }},
{ label: 'Profile', type: 'id', data: { ref: 'profileRef', url: 'url', value: 'name' }},
{ label: 'Permission Sets', type: 'ids', data: { ref: 'permissionSetRefs', url: 'url', value: 'name' }}
];

usersTableData;

visualForceComponentsTableColumns = [
Expand Down

0 comments on commit cd74665

Please sign in to comment.