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,22 +44,11 @@ public class IndividualTemplateModel extends BaseTemplateModel {
|
||||||
this.urlBuilder = new UrlBuilder(vreq.getPortal());
|
this.urlBuilder = new UrlBuilder(vreq.getPortal());
|
||||||
|
|
||||||
// If editing, create a helper object to check requested actions against policies
|
// If editing, create a helper object to check requested actions against policies
|
||||||
if (isEditable(loginStatusBean)) {
|
if (isEditable()) {
|
||||||
policyHelper = new EditingPolicyHelper(vreq, getServletContext());
|
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) {
|
private boolean isVClass(String vClassUri) {
|
||||||
boolean isVClass = individual.isVClass(vClassUri);
|
boolean isVClass = individual.isVClass(vClassUri);
|
||||||
// If reasoning is asynchronous (under RDB), this inference may not have been made yet.
|
// If reasoning is asynchronous (under RDB), this inference may not have been made yet.
|
||||||
|
@ -165,9 +154,9 @@ public class IndividualTemplateModel extends BaseTemplateModel {
|
||||||
|
|
||||||
public boolean isEditable() {
|
public boolean isEditable() {
|
||||||
// RY This will be improved later. What is important is not whether the user is a self-editor,
|
// 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.
|
// but whether he has editing privileges on this profile. This is just a crude way of determining
|
||||||
return VitroRequestPrep.isSelfEditing(vreq) ||
|
// whether to even bother looking at the editing policies.
|
||||||
loginStatusBean.isLoggedInAtLeast(LoginStatusBean.NON_EDITOR);
|
return VitroRequestPrep.isSelfEditing(vreq) || loginStatusBean.isLoggedIn();
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean getShowAdminPanel() {
|
public boolean getShowAdminPanel() {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue