NIHVIVO-1919 Fix error on individual page for editors and non-editors by removing one of two conflicting isEditable() methods in IndividualTemplateModel
This commit is contained in:
parent
4e9e3b98b3
commit
ee34640e15
1 changed files with 4 additions and 15 deletions
|
@ -44,21 +44,10 @@ public class IndividualTemplateModel extends BaseTemplateModel {
|
|||
this.urlBuilder = new UrlBuilder(vreq.getPortal());
|
||||
|
||||
// If editing, create a helper object to check requested actions against policies
|
||||
if (isEditable(loginStatusBean)) {
|
||||
if (isEditable()) {
|
||||
policyHelper = new EditingPolicyHelper(vreq, getServletContext());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Return true iff the user is editing.
|
||||
* These tests may change once self-editing issues are straightened out. What we really need to know
|
||||
* is whether the user can edit this profile, not whether in general he/she is an editor.
|
||||
*/
|
||||
private boolean isEditable(LoginStatusBean loginStatusBean) {
|
||||
boolean isSelfEditing = VitroRequestPrep.isSelfEditing(vreq);
|
||||
boolean isCurator = loginStatusBean.isLoggedInAtLeast(LoginStatusBean.CURATOR);
|
||||
return isSelfEditing || isCurator;
|
||||
}
|
||||
|
||||
private boolean isVClass(String vClassUri) {
|
||||
boolean isVClass = individual.isVClass(vClassUri);
|
||||
|
@ -165,9 +154,9 @@ public class IndividualTemplateModel extends BaseTemplateModel {
|
|||
|
||||
public boolean isEditable() {
|
||||
// RY This will be improved later. What is important is not whether the user is a self-editor,
|
||||
// but whether he has editing privileges on this profile.
|
||||
return VitroRequestPrep.isSelfEditing(vreq) ||
|
||||
loginStatusBean.isLoggedInAtLeast(LoginStatusBean.NON_EDITOR);
|
||||
// but whether he has editing privileges on this profile. This is just a crude way of determining
|
||||
// whether to even bother looking at the editing policies.
|
||||
return VitroRequestPrep.isSelfEditing(vreq) || loginStatusBean.isLoggedIn();
|
||||
}
|
||||
|
||||
public boolean getShowAdminPanel() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue