Move ACL editor into a separate template

The user rights remain dynamic, based on the object type (addressbook vs
mailbox vs calendar).
This commit is contained in:
Francis Lachapelle
2014-11-03 15:58:54 -05:00
parent 97ce3e6b72
commit c063832d0d
5 changed files with 122 additions and 151 deletions
@@ -38,7 +38,8 @@
$timeout: $timeout,
$$resource: new Resource(Settings.baseURL),
$Card: Card,
$$Acl: Acl
$$Acl: Acl,
activeUser: Settings.activeUser
});
return AddressBook; // return constructor
@@ -77,6 +78,9 @@
// Instanciate AddressBook objects
angular.forEach(this.$addressbooks, function(o, i) {
_this.$addressbooks[i] = new AddressBook(o);
// Add 'isOwned' attribute based on active user (TODO: add it server-side?)
_this.$addressbooks[i].isOwned = _this.activeUser.isSuperUser
|| _this.$addressbooks[i].owner == _this.activeUser.login;
});
}
return this.$addressbooks;