Skip to content

Commit

Permalink
update: remove non-necessary comments
Browse files Browse the repository at this point in the history
  • Loading branch information
sumeyyeKurtulus committed May 16, 2024
1 parent 4f5d1b6 commit e7e1ef0
Showing 1 changed file with 0 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -211,21 +211,17 @@ export class ExtensibleTableComponent<R = any> implements OnChanges {
const visibleActions = actions.filter(action => {
const { visible, permission } = action;

// Case 1: assuming that the action has neither permission nor visible properties, so no need to make an extra check
let isVisible = true;
let hasPermission = true;

// Case 2: action has visible condition
if (visible) {
isVisible = visible({ record: rowData, getInjected: this.getInjected });
}

// Case 3: action has permission condition
if (permission) {
hasPermission = this.permissionService.getGrantedPolicy(permission);
}

// Return true if the action is both visible and has permission, otherwise return false
return isVisible && hasPermission;
});

Expand Down

0 comments on commit e7e1ef0

Please sign in to comment.