mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-06-02 08:59:45 +00:00
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:
@@ -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;
|
||||
|
||||
@@ -9,7 +9,13 @@
|
||||
angular.module('SOGo.ContactsUI', ['ngSanitize', 'ui.router', 'mm.foundation', 'SOGo.Common', 'SOGo.UIDesktop'])
|
||||
|
||||
.constant('sgSettings', {
|
||||
baseURL: ApplicationBaseURL
|
||||
baseURL: ApplicationBaseURL,
|
||||
activeUser: {
|
||||
login: UserLogin,
|
||||
language: UserLanguage,
|
||||
folderURL: UserFolderURL,
|
||||
isSuperUser: IsSuperUser
|
||||
}
|
||||
})
|
||||
|
||||
.config(['$stateProvider', '$urlRouterProvider', function($stateProvider, $urlRouterProvider) {
|
||||
@@ -181,7 +187,7 @@
|
||||
};
|
||||
$scope.share = function() {
|
||||
var modal = $modal.open({
|
||||
templateUrl: 'addressbookSharing.html',
|
||||
templateUrl: stateAddressbook.id + '/aclsTemplate',
|
||||
resolve: {
|
||||
modalUsers: function() {
|
||||
return stateAddressbook.$acl.$users();
|
||||
|
||||
Reference in New Issue
Block a user