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:
rjy7 2011-01-26 19:43:05 +00:00
parent 4e9e3b98b3
commit ee34640e15

View file

@ -44,22 +44,11 @@ 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);
// 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() {
// 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() {