Skip to content

Commit

Permalink
fix: added a new property to page that checks if the user has rules r…
Browse files Browse the repository at this point in the history
…ead permission (#28919)
  • Loading branch information
gortiz-dotcms committed Dec 11, 2024
1 parent 01d2b24 commit 8789d02
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ export interface DotPage {
inode: string;
canEdit: boolean;
canRead: boolean;
canSeeRules: boolean;
canLock?: boolean;
locked?: boolean;
lockedBy?: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ export const UVEStore = signalStore(
label: 'editema.editor.navbar.rules',
id: 'rules',
href: `rules/${page?.identifier}`,
isDisabled: !page?.canEdit || !isEnterpriseLicense
isDisabled: !page?.canSeeRules || !page?.canEdit || !isEnterpriseLicense
},
{
iconURL: 'experiments',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@ protected Map<String, Object> transform(final HTMLPageAsset page, final Map<Stri
map.put("canEdit", toolBox.permissionAPI.doesUserHavePermission(page, PermissionLevel.EDIT.getType(), user, false));
map.put("canRead", toolBox.permissionAPI.doesUserHavePermission(page, PermissionLevel.READ.getType(), user, false));
map.put("canLock", canLock(page, user));
map.put("canSeeRules", toolBox.permissionAPI.doesUserHavePermissions(page, "RULES: " + PermissionLevel.READ.getType(), user, false));


if(info.isPresent() && info.get().getLockedBy()!=null) {
map.put("lockedOn", info.get().getLockedOn());
Expand Down

0 comments on commit 8789d02

Please sign in to comment.