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

refined category permission checks

This commit is contained in:
Harvey Kandola 2017-09-21 18:59:43 +01:00
parent 4d989e2497
commit 3a9675eb14
11 changed files with 149 additions and 22 deletions

View file

@ -85,10 +85,19 @@ export default BaseService.extend({
});
},
// Get list of users who can see given category
getViewers(categoryId) {
// Get viewer permission records for given category
getPermissions(categoryId) {
return this.get('ajax').request(`category/${categoryId}/permission`, {
method: 'GET'
}).then((response) => {
return response;
});
},
// Get list of users who can see given category
getUsers(categoryId) {
return this.get('ajax').request(`category/${categoryId}/user`, {
method: 'GET'
}).then((response) => {
let data = [];
@ -109,4 +118,13 @@ export default BaseService.extend({
data: JSON.stringify(viewers)
});
},
// Get count of documents and users associated with each category in given space.
getSummary(spaceId) {
return this.get('ajax').request(`category/space/${spaceId}/summary`, {
method: 'GET'
}).then((response) => {
return response;
});
}
});