This repository has been archived by the owner on Nov 4, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 896
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
the-djmaze
committed
Aug 20, 2024
1 parent
5987ccd
commit e5a176f
Showing
7 changed files
with
263 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.