mirror of
https://github.com/documize/community.git
synced 2025-08-03 04:25:25 +02:00
Improve Space permissions
Closes out loopholes that allowed managers to kick owners.
This commit is contained in:
parent
09635b67ab
commit
5d632712e0
30 changed files with 1015 additions and 877 deletions
|
@ -335,7 +335,7 @@ export default Service.extend({
|
|||
} else {
|
||||
let id = this.get('storageSvc').getSessionItem('anonId');
|
||||
|
||||
if (is.not.null(id) && is.not.undefined(id) && id.length === 16) {
|
||||
if (is.not.null(id) && is.not.undefined(id) && id.length >= 16) {
|
||||
userId = id;
|
||||
} else {
|
||||
userId = stringUtil.anonUserId();
|
||||
|
|
|
@ -174,8 +174,9 @@ export default BaseService.extend({
|
|||
});
|
||||
},
|
||||
|
||||
// returns all spaces -- for use by documize admin user
|
||||
adminList() {
|
||||
// Returns all shared spaces and spaces without an owner.
|
||||
// Administrator only method.
|
||||
manage() {
|
||||
return this.get('ajax').request(`space/manage`, {
|
||||
method: "GET"
|
||||
}).then((response) => {
|
||||
|
@ -189,5 +190,12 @@ export default BaseService.extend({
|
|||
|
||||
return data;
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
// Add admin as space owner.
|
||||
grantOwnerPermission(folderId) {
|
||||
return this.get('ajax').request(`space/manage/owner/${folderId}`, {
|
||||
method: 'POST',
|
||||
});
|
||||
},
|
||||
});
|
||||
|
|
|
@ -236,10 +236,12 @@ export default Service.extend({
|
|||
});
|
||||
},
|
||||
|
||||
deactivate() {
|
||||
deactivate(comment) {
|
||||
if(this.get('sessionService.isAdmin')) {
|
||||
return this.get('ajax').request(`deactivate`, {
|
||||
method: 'POST',
|
||||
contentType: 'text',
|
||||
data: comment,
|
||||
}).then(() => {
|
||||
return;
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue