Commit 5bcfa407 authored by Gradl, Tobias's avatar Gradl, Tobias
Browse files

71: Security (mainly admin sections)

Task-Url: https://pm.winseda.de/issues/71
parent 76b1c1e9
......@@ -81,6 +81,8 @@ var Util = function() {
"'" : ''',
"/" : '/'
};
this.ulevel = $("#ulevel").val()=="" ? 0 : parseInt($("#ulevel").val());
};
var __util = new Util();
......
......@@ -15,7 +15,8 @@ var SchemaEditor = function() {
"~eu.dariah.de.minfba.common.status.ok",
"~eu.dariah.de.minfba.common.status.outdated",
"~eu.dariah.de.minfba.search.view.api.status_code",
"~eu.dariah.de.minfba.search.view.models.show_in_DME"
"~eu.dariah.de.minfba.search.view.models.show_in_DME",
"~eu.dariah.de.minfba.common.actions.delete"
]);
this.createTable();
......@@ -23,6 +24,8 @@ var SchemaEditor = function() {
this.getScheregStatus();
};
//<c:if test="${_auth.level >= 100}">
SchemaEditor.prototype = new BaseTable(__util.getBaseUrl() + "datamodels/async/getData", "#schemas-table-container");
......@@ -160,8 +163,10 @@ SchemaEditor.prototype.renderActionColumn = function(row, type, val, meta) {
}
var result = "";
result += "<button type='button' onclick='editor.triggerClearIndex(\"" + row.entity.id + "\"); return false;' class='btn btn-xs btn-link'><span class='glyphicon glyphicon-retweet'></span> " + __translator.translate("~eu.dariah.de.minfba.search.actions.schemas.clear") + "</button>";
result += "<button type='button' onclick='editor.triggerDropSchema(\"" + row.entity.id + "\"); return false;' class='btn btn-xs btn-link'><span class='glyphicon glyphicon-trash'></span> ~Delete</button>";
if (__util.ulevel >= 100) {
result += "<button type='button' onclick='editor.triggerClearIndex(\"" + row.entity.id + "\"); return false;' class='btn btn-xs btn-link'><span class='glyphicon glyphicon-retweet'></span> " + __translator.translate("~eu.dariah.de.minfba.search.actions.schemas.clear") + "</button>";
result += "<button type='button' onclick='editor.triggerDropSchema(\"" + row.entity.id + "\"); return false;' class='btn btn-xs btn-link'><span class='glyphicon glyphicon-trash'></span> " + __translator.translate("~eu.dariah.de.minfba.common.actions.delete") + "</button>";
}
/*result += "<div class='btn-group'>" +
"<button type='button' class='btn btn-default btn-xs'>~ View stats</button>" +
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment