2020-09-30 11:33:01 +00:00
|
|
|
import RepositoryService from 'consul-ui/services/repository';
|
|
|
|
const modelName = 'intention-permission';
|
2020-11-09 09:25:35 +00:00
|
|
|
export default class IntentionPermissionService extends RepositoryService {
|
|
|
|
getModelName() {
|
2020-09-30 11:33:01 +00:00
|
|
|
return modelName;
|
2020-11-09 09:25:35 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
create(obj = {}) {
|
2020-09-30 11:33:01 +00:00
|
|
|
// intention-permission and intention-permission-http
|
|
|
|
// are currently treated as one and the same
|
|
|
|
return this.store.createFragment(this.getModelName(), {
|
|
|
|
...obj,
|
|
|
|
HTTP: this.store.createFragment('intention-permission-http', obj.HTTP || {}),
|
|
|
|
});
|
2020-11-09 09:25:35 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
persist(item) {
|
2020-09-30 11:33:01 +00:00
|
|
|
return item.execute();
|
2020-11-09 09:25:35 +00:00
|
|
|
}
|
|
|
|
}
|