feat: 🎸 host catalogs create/list capability

This commit is contained in:
dharini committed 2021-08-31 15:17:57 -07:00
1 parent 8b51bcf95b
commit f344d73f32
10 files changed
+207 -25

No files matched your search

+2 -1
View File
@@ -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);
}
+6 -1
View File
@@ -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();
@@ -52,7 +57,7 @@ export default class BaseModel extends Model {
/**
* Convenience for getting and setting the parent scope ID.
* @type {string
* @type {string}
*/
@computed('scope.scope_id')
get scopeID() {