NIHVIVO-2492 A better implementation to allow RequiresAuthorizationFor this or that.
This commit is contained in:
parent
d246b7b9e0
commit
98d9be5cf2
1 changed files with 10 additions and 7 deletions
|
@ -67,17 +67,20 @@ public class SiteAdminController extends FreemarkerHttpServlet {
|
||||||
// of step with the levels required by the pages themselves. We should implement a
|
// of step with the levels required by the pages themselves. We should implement a
|
||||||
// mechanism similar to what's used on the front end to display links to Site Admin
|
// mechanism similar to what's used on the front end to display links to Site Admin
|
||||||
// and Revision Info iff the user has access to those pages.
|
// and Revision Info iff the user has access to those pages.
|
||||||
|
// jeb228 This could be done with
|
||||||
|
// PolicyHelper.areRequiredAuthorizationsSatisfied(req, SomeServlet.class);
|
||||||
if (loginBean.isLoggedInAtLeast(LoginStatusBean.CURATOR)) {
|
if (loginBean.isLoggedInAtLeast(LoginStatusBean.CURATOR)) {
|
||||||
body.put("siteConfig", getSiteConfigurationData(vreq, urlBuilder));
|
body.put("siteConfig", getSiteConfigurationData(vreq, urlBuilder));
|
||||||
|
}
|
||||||
|
if (loginBean.isLoggedInAtLeast(LoginStatusBean.CURATOR)) {
|
||||||
body.put("ontologyEditor", getOntologyEditorData(vreq, urlBuilder));
|
body.put("ontologyEditor", getOntologyEditorData(vreq, urlBuilder));
|
||||||
|
}
|
||||||
if (PolicyHelper.isAuthorized(vreq, UseAdvancedDataToolsPages.class)) {
|
if (PolicyHelper.isActionAuthorized(vreq, UseAdvancedDataToolsPages.class)) {
|
||||||
body.put("dataTools", getDataToolsData(vreq, urlBuilder));
|
body.put("dataTools", getDataToolsData(vreq, urlBuilder));
|
||||||
|
|
||||||
// Only for DataStar. Should handle without needing a DataStar-specific version of this controller.
|
// Only for DataStar. Should handle without needing a DataStar-specific version of this controller.
|
||||||
//body.put("customReports", getCustomReportsData(vreq));
|
//body.put("customReports", getCustomReportsData(vreq));
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
return new TemplateResponseValues(TEMPLATE_DEFAULT, body);
|
return new TemplateResponseValues(TEMPLATE_DEFAULT, body);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue