grp
This commit is contained in:
1 parent
b652f759c8
commit
b2f11f712b
10 files changed
+154
-17
No files matched your search
@@ -29,7 +29,8 @@ export default class CollectionAbility extends Ability {
|
||||
* @return {boolean}
|
||||
*/
|
||||
hasAuthorizedCollectionAction(action) {
|
||||
const { authorized_collection_actions } = this.model;
|
||||
const authorized_collection_actions =
|
||||
(this.model || {}).authorized_collection_actions || {};
|
||||
const collection = this.collection || {};
|
||||
return authorized_collection_actions[collection]?.includes(action);
|
||||
}
|
||||
|
||||
@@ -42,6 +42,11 @@ export default class BaseModel extends Model {
|
||||
})
|
||||
authorized_actions;
|
||||
|
||||
@attr({
|
||||
readOnly: true,
|
||||
})
|
||||
authorized_collection_actions;
|
||||
|
||||
set scopeModel(model) {
|
||||
if (model) {
|
||||
const json = model.serialize();
|
||||
|
||||
Reference in new issue
Block a user