fixed operation bar permission rendering issue

revert-dabc3590
ayyoob 8 years ago
parent 360a58dce6
commit 77ec1c4107

@ -60,7 +60,19 @@ var operationModule = function () {
feature["description"] = features[i].description; feature["description"] = features[i].description;
feature["deviceType"] = deviceType; feature["deviceType"] = deviceType;
feature["params"] = []; feature["params"] = [];
var metaData = features[i].metadataEntries; var featuresEntry = utility.getDeviceTypeConfig(deviceType)["deviceType"]["features"];
if (featuresEntry) {
var featureEntry = featuresEntry[features[i].code];
if (featureEntry) {
var permissionEntry = featureEntry["permission"];
log.error(permissionEntry);
if (permissionEntry) {
feature["permission"] = permissionEntry
}
}
}
var metaData = features[i].metadataEntries;
if (metaData) { if (metaData) {
for (var j = 0; j < metaData.length; j++) { for (var j = 0; j < metaData.length; j++) {
feature["params"].push(metaData[j].value); feature["params"].push(metaData[j].value);

@ -113,11 +113,6 @@
</div> </div>
{{/each}} {{/each}}
</div> </div>
{{else}}
<div align="center">
<h4 style="color: #D8000C"><i class="icon fw fw-error" style="color: #D8000C"></i>
Operations Loading Failed!</h4>
</div>
{{/if}} {{/if}}
<div id="operation-response-template" style="display: none"> <div id="operation-response-template" style="display: none">

@ -31,8 +31,8 @@ function onRequest(context) {
var pathParams = []; var pathParams = [];
for (var i = 0; i < allControlOps.length; i++) { for (var i = 0; i < allControlOps.length; i++) {
var controlOperation = {}; var controlOperation = {};
var uiPermission = allControlOps[i]["uiPermission"]; var uiPermission = allControlOps[i]["permission"];
if (uiPermission && !userModule.isAuthorized("/permission/admin/" + uiPermission)) { if (uiPermission && !userModule.isAuthorized("/permission/admin" + uiPermission)) {
continue; continue;
} }
controlOperation = allControlOps[i]; controlOperation = allControlOps[i];

Loading…
Cancel
Save