1
0
Fork 0
mirror of https://github.com/documize/community.git synced 2025-08-05 05:25:27 +02:00

category permission admin, re-vamped view layout

This commit is contained in:
Harvey Kandola 2017-09-21 15:48:00 +01:00
parent 0c152c219f
commit 3f31d6d15e
48 changed files with 753 additions and 373 deletions

View file

@ -83,5 +83,30 @@ export default BaseService.extend({
return this.get('ajax').request(`category/${categoryId}`, {
method: 'DELETE'
});
}
},
// Get list of users who can see given category
getViewers(categoryId) {
return this.get('ajax').request(`category/${categoryId}/permission`, {
method: 'GET'
}).then((response) => {
let data = [];
data = response.map((obj) => {
let data = this.get('store').normalize('user', obj);
return this.get('store').push(data);
});
return data;
});
},
// Save list of users who can see given category
setViewers(categoryId, viewers) {
return this.get('ajax').request(`category/${categoryId}/permission`, {
method: 'PUT',
contentType: 'json',
data: JSON.stringify(viewers)
});
},
});

View file

@ -66,7 +66,6 @@ export default Ember.Service.extend({
});
},
// Returns all users that can see folder.
getFolderUsers(folderId) {
let url = `users/folder/${folderId}`;