mirror of
https://github.com/sismics/docs.git
synced 2025-12-21 05:31:42 +00:00
Closes #91: Display ACL inherited from tags in document permissions
This commit is contained in:
@@ -3,5 +3,11 @@
|
||||
/**
|
||||
* Document view permissions controller.
|
||||
*/
|
||||
angular.module('docs').controller('DocumentViewPermissions', function() {
|
||||
angular.module('docs').controller('DocumentViewPermissions', function($scope) {
|
||||
// Watch for ACLs change and group them for easy displaying
|
||||
$scope.$watch('document.inherited_acls', function(acls) {
|
||||
$scope.inheritedAcls = _.groupBy(acls, function(acl) {
|
||||
return acl.id;
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -8,12 +8,12 @@
|
||||
<tr ng-repeat="(id, acl) in groupedAcls">
|
||||
<td><acl data="acl[0]"></acl></td>
|
||||
<td>
|
||||
<span class="label label-default" style="margin-right: 6px;" ng-repeat="a in acl | orderBy: 'perm'">
|
||||
{{ a.perm }}
|
||||
<span ng-show="(creator != a.name && a.type == 'USER' || a.type != 'USER') && writable"
|
||||
class="glyphicon glyphicon-remove pointer"
|
||||
ng-click="deleteAcl(a)"></span>
|
||||
</span>
|
||||
<span class="label label-default" style="margin-right: 6px;" ng-repeat="a in acl | orderBy: 'perm'">
|
||||
{{ a.perm }}
|
||||
<span ng-show="(creator != a.name && a.type == 'USER' || a.type != 'USER') && writable"
|
||||
class="glyphicon glyphicon-remove pointer"
|
||||
ng-click="deleteAcl(a)"></span>
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
@@ -1 +1,3 @@
|
||||
<p class="well-sm">Every actions on this document are logged here.</p>
|
||||
|
||||
<audit-log logs="logs" />
|
||||
@@ -1,4 +1,37 @@
|
||||
<acl-edit source="document.id"
|
||||
acls="document.acls"
|
||||
writable="document.writable"
|
||||
creator="document.creator"></acl-edit>
|
||||
<p class="well-sm">Permissions can be applied directly to this document, or can come from <a href="#/tag">tags</a>.</p>
|
||||
|
||||
<div class="well" ng-show="document.inherited_acls.length > 0">
|
||||
<h3>Permissions inherited by tags</h3>
|
||||
|
||||
<table class="table">
|
||||
<tr>
|
||||
<th style="width: 30%">From</th>
|
||||
<th style="width: 30%">For</th>
|
||||
<th style="width: 30%">Permission</th>
|
||||
</tr>
|
||||
|
||||
<tr ng-repeat="(id, acl) in inheritedAcls">
|
||||
<td>
|
||||
<a href="#/tag/{{ acl[0].source_id }}">
|
||||
<span class="glyphicon glyphicon-tags"></span>
|
||||
{{ acl[0].source_name }}
|
||||
</a>
|
||||
</td>
|
||||
<td><acl data="acl[0]"></acl></td>
|
||||
<td>
|
||||
<span class="label label-default" style="margin-right: 6px;" ng-repeat="a in acl | orderBy: 'perm'">
|
||||
{{ a.perm }}
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="well">
|
||||
<h3>Permissions on this document</h3>
|
||||
|
||||
<acl-edit source="document.id"
|
||||
acls="document.acls"
|
||||
writable="document.writable"
|
||||
creator="document.creator"></acl-edit>
|
||||
</div>
|
||||
@@ -1,3 +1,7 @@
|
||||
<h1>{{ tag.name }}</h1>
|
||||
|
||||
<p>Permissions on this tag will also be applied to documents tagged <span class="label label-info">{{ tag.name }}</span></p>
|
||||
|
||||
<acl-edit source="tag.id"
|
||||
acls="tag.acls"
|
||||
writable="tag.writable"
|
||||
|
||||
Reference in New Issue
Block a user