Skip to content

Commit

Permalink
Merge pull request #3952 from erwinwinder/fix/3894-1.11
Browse files Browse the repository at this point in the history
[1.11] Fix #3894 Too much and unexplained "Inherited from hierarchy" permissions on ImportRun
  • Loading branch information
mark-de-haan committed Oct 16, 2015
2 parents 7013d8f + 570d1e1 commit f2f7da1
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions molgenis-core-ui/src/main/resources/js/permissionmanager.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,17 @@
items.push('<td><input type="radio" name="radio-' + entityId + '" value="none" checked></td>');
items.push('</tr>');
}
if(data.hierarchyPermissionMap && data.hierarchyPermissionMap[entityId.toLowerCase()]) {
$.each(data.hierarchyPermissionMap[entityId.toLowerCase()], function(idx, perm) {
items.push('<tr>');
items.push('<td><span class="muted inherited-permission">inherited from hierarchy</span></td>');
items.push('<td><input type="radio"' + (perm.type === "write" ? ' checked' : '') + ' disabled></td>');
items.push('<td><input type="radio"' + (perm.type === "read" ? ' checked' : '') + ' disabled></td>');
items.push('<td><input type="radio"' + (perm.type === "count" ? ' checked' : '') + ' disabled></td>');
items.push('<td><input type="radio"' + (perm.type ? '' : ' checked') + ' disabled></td>');
items.push('</tr>');
});
}
if(data.groupPermissionMap && data.groupPermissionMap[entityId.toLowerCase()]) {
$.each(data.groupPermissionMap[entityId.toLowerCase()], function(idx, perm) {
items.push('<tr>');
Expand Down Expand Up @@ -106,6 +117,12 @@
success : function(data) {
$('#plugin-container .alert').remove();
$('#plugin-container').prepend('<div class="alert alert-success"><button type="button" class="close" data-dismiss="alert">&times;</button><strong>Success!</strong> Updated plugin permissions</div>');

//Refresh
$('#plugin-group-select').change();
$('#entity-class-group-select').change();
$('#plugin-user-select').change();
$('#entity-class-user-select').change();
},
error: function (xhr, textStatus, errorThrown) {
var errorMessage = JSON.parse(xhr.responseText).errorMessage;
Expand Down

0 comments on commit f2f7da1

Please sign in to comment.