mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-13 03:27:39 +03:00
Added editing of ACL rules #157
This commit is contained in:
parent
5987ccdbc9
commit
e5a176f5ea
7 changed files with 263 additions and 40 deletions
58
dev/View/Popup/FolderAcl.js
Normal file
58
dev/View/Popup/FolderAcl.js
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
import { AbstractViewPopup } from 'Knoin/AbstractViews';
|
||||
import { addObservablesTo } from 'External/ko';
|
||||
import Remote from 'Remote/User/Fetch';
|
||||
|
||||
export class FolderACLPopupView extends AbstractViewPopup {
|
||||
constructor() {
|
||||
super('FolderACL');
|
||||
addObservablesTo(this, {
|
||||
create: false,
|
||||
mine: false,
|
||||
folderName: '',
|
||||
identifier: ''
|
||||
});
|
||||
this.rights = ko.observableArray();
|
||||
}
|
||||
|
||||
submitForm(/*form*/) {
|
||||
if (!this.mine()) {
|
||||
const rights = this.rights();
|
||||
Remote.request('FolderSetACL',
|
||||
(iError, data) => {
|
||||
if (!iError && data.Result) {
|
||||
const acl = this.acl;
|
||||
if (!acl.identifier) {
|
||||
this.folder.ACL.push(acl);
|
||||
}
|
||||
acl.rights = rights;
|
||||
}
|
||||
}, {
|
||||
folder: this.folderName(),
|
||||
identifier: this.identifier(),
|
||||
rights: rights.join('')
|
||||
}
|
||||
);
|
||||
}
|
||||
this.close();
|
||||
}
|
||||
|
||||
beforeShow(folder, acl) {
|
||||
this.folder = folder;
|
||||
this.create(!acl.identifier());
|
||||
this.mine(acl.mine());
|
||||
this.acl = acl;
|
||||
/*
|
||||
this.ACLAllowed && Remote.request('FolderIdentifierRights', (iError, data) => {
|
||||
if (!iError && data.Result) {
|
||||
this.rights(data.Result.rights.split(''));
|
||||
}
|
||||
}, {
|
||||
folder: folder.fullName,
|
||||
identifier: acl.identifier
|
||||
});
|
||||
*/
|
||||
this.folderName(folder.fullName);
|
||||
this.identifier(acl.identifier());
|
||||
this.rights(acl.rights());
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue