Skip to content

Commit

Permalink
🔧 chore(Edit Interceptor): add superadmin permissions
Browse files Browse the repository at this point in the history
  • Loading branch information
MetalPrime committed Feb 5, 2025
1 parent 7ad364d commit 83c9643
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,13 @@ void setPermissionParameters(ActionInvocation invocation) throws Exception {
baseAction.setEditableParameter(false);
}

// Allow Superadmin edit
if (baseAction.canAccessSuperAdmin() && editParameter) {
baseAction.setEditableParameter(true);
baseAction.setCanEdit(true);
baseAction.setEditStatus(true);
}


} else {
throw new NullPointerException();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,13 @@ void setPermissionParameters(ActionInvocation invocation) throws Exception {
baseAction.setCanEdit(canEdit);
baseAction.setCanSwitchProject(canSwitchProject);

// Allow Superadmin edit
if (baseAction.canAccessSuperAdmin() && editParameter) {
baseAction.setEditableParameter(true);
baseAction.setCanEdit(true);
baseAction.setEditStatus(true);
}

} else {
throw new NullPointerException();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
[@logHistory.logList list=recordsList itemName="innovationID" itemId=innovation.id /]
<a href="" onclick="return false" class="form-button button-history"><span class="glyphicon glyphicon-glyphicon glyphicon-list-alt" aria-hidden="true"></span> [@s.text name="form.buttons.history" /]</a>
[/#if]
[#if (editable && !(transaction??) )]
[#if (editable && !(transaction??) ) || editStatus]
[#-- Discard Button --]
[@s.submit type="button" cssStyle="display:none" name="cancel" cssClass="button-cancel"]<span class="glyphicon glyphicon-trash" aria-hidden="true"></span> [@s.text name="form.buttons.discard" /] [/@s.submit]

Expand Down

0 comments on commit 83c9643

Please sign in to comment.