mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-30 20:49:20 +03:00
Improved ACL handling #157
This commit is contained in:
parent
7e304daee0
commit
306d3ec7b5
8 changed files with 110 additions and 116 deletions
|
|
@ -402,8 +402,6 @@ export class FolderModel extends AbstractModel {
|
|||
}
|
||||
),
|
||||
|
||||
canBeEdited: () => !this.type() && this.exists/* && this.selectable()*/,
|
||||
|
||||
isSystemFolder: () => this.type()
|
||||
| (FolderUserStore.allowKolab() && !!this.kolabType() & !SettingsUserStore.unhideKolabFolders()),
|
||||
|
||||
|
|
@ -484,8 +482,7 @@ export class FolderModel extends AbstractModel {
|
|||
}
|
||||
|
||||
edit() {
|
||||
// this.canBeEdited() && this.editing(true);
|
||||
this.canBeEdited() && showScreenPopup(FolderPopupView, [this]);
|
||||
showScreenPopup(FolderPopupView, [this]);
|
||||
}
|
||||
|
||||
unedit() {
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@
|
|||
}
|
||||
|
||||
.folder-name {
|
||||
cursor: pointer;
|
||||
word-break: break-all;
|
||||
white-space: pre-wrap;
|
||||
}
|
||||
|
|
@ -24,10 +25,6 @@
|
|||
opacity: 0.6;
|
||||
}
|
||||
|
||||
.folder-name.can-be-edited {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
select {
|
||||
width: auto;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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