mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-13 03:27:39 +03:00
Improved ACL handling #157
This commit is contained in:
parent
7e304daee0
commit
306d3ec7b5
8 changed files with 110 additions and 116 deletions
|
|
@ -1,8 +1,7 @@
|
|||
import { addObservablesTo } from 'External/ko';
|
||||
|
||||
import { AbstractViewPopup } from 'Knoin/AbstractViews';
|
||||
|
||||
import { addObservablesTo } from 'External/ko';
|
||||
import Remote from 'Remote/User/Fetch';
|
||||
import { FolderUserStore } from 'Stores/User/Folder';
|
||||
|
||||
export class FolderPopupView extends AbstractViewPopup {
|
||||
constructor() {
|
||||
|
|
@ -10,7 +9,7 @@ export class FolderPopupView extends AbstractViewPopup {
|
|||
addObservablesTo(this, {
|
||||
folder: null // FolderModel
|
||||
});
|
||||
|
||||
this.ACLAllowed = FolderUserStore.hasCapability('ACL');
|
||||
this.ACL = ko.observableArray();
|
||||
}
|
||||
|
||||
|
|
@ -26,19 +25,14 @@ export class FolderPopupView extends AbstractViewPopup {
|
|||
|
||||
beforeShow(folder) {
|
||||
this.ACL([]);
|
||||
folder.editing(true);
|
||||
this.folder(folder);
|
||||
Remote.request('FolderACL', (iError, data) => {
|
||||
this.ACLAllowed && Remote.request('FolderACL', (iError, data) => {
|
||||
if (!iError && data.Result) {
|
||||
this.ACL(
|
||||
Object.entries(data.Result).map(([key, value]) => {
|
||||
value.identifier = key;
|
||||
return value;
|
||||
})
|
||||
);
|
||||
this.ACL(Object.values(data.Result));
|
||||
}
|
||||
}, {
|
||||
folder: folder.fullName
|
||||
});
|
||||
!folder.type() && folder.exists && folder.selectable() && folder.editing(true);
|
||||
this.folder(folder);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue