1
0
Fork 0
mirror of https://github.com/documize/community.git synced 2025-08-02 12:05:23 +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)
});
},
});