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:
parent
0c152c219f
commit
3f31d6d15e
48 changed files with 753 additions and 373 deletions
|
@ -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)
|
||||
});
|
||||
},
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue