chore: 🤖 bump ember-can (#3093)
* chore: 🤖 bump ember-can * chore: 🤖 rename "can" service (deprecated) to abilities See https://github.com/minutebase/ember-can/pull/152 * chore: 🤖 bump to ember-can@^8 * chore: 🤖 extend resolver for ember-can v7 breaking change https://github.com/minutebase/ember-can/pull/186
This commit is contained in:
1 parent
29fb5b00cb
commit
b5d33948dc
107 files changed
+542
-435
No files matched your search
@@ -14,7 +14,7 @@ import { confirm } from 'core/decorators/confirm';
|
||||
export default class ScopesScopeAliasesIndexController extends Controller {
|
||||
// =services
|
||||
|
||||
@service can;
|
||||
@service abilities;
|
||||
@service intl;
|
||||
@service router;
|
||||
|
||||
@@ -41,10 +41,10 @@ export default class ScopesScopeAliasesIndexController extends Controller {
|
||||
* @type {string}
|
||||
*/
|
||||
get messageDescription() {
|
||||
const canList = this.can.can('list model', this.scope, {
|
||||
const canList = this.abilities.can('list model', this.scope, {
|
||||
collection: 'aliases',
|
||||
});
|
||||
const canCreate = this.can.can('create model', this.scope, {
|
||||
const canCreate = this.abilities.can('create model', this.scope, {
|
||||
collection: 'aliases',
|
||||
});
|
||||
const resource = this.intl.t('resources.alias.title_plural');
|
||||
@@ -84,7 +84,7 @@ export default class ScopesScopeAliasesIndexController extends Controller {
|
||||
)
|
||||
async save(alias) {
|
||||
await alias.save();
|
||||
if (this.can.can('read model', alias)) {
|
||||
if (this.abilities.can('read model', alias)) {
|
||||
await this.router.transitionTo('scopes.scope.aliases.alias', alias);
|
||||
} else {
|
||||
this.router.transitionTo('scopes.scope.aliases');
|
||||
|
||||
@@ -15,7 +15,7 @@ export default class ScopesScopeAuthMethodsAuthMethodAccountsIndexController ext
|
||||
|
||||
// =services
|
||||
|
||||
@service can;
|
||||
@service abilities;
|
||||
@service intl;
|
||||
@service router;
|
||||
|
||||
@@ -28,10 +28,10 @@ export default class ScopesScopeAuthMethodsAuthMethodAccountsIndexController ext
|
||||
* @type {string}
|
||||
*/
|
||||
get messageDescription() {
|
||||
const canList = this.can.can('list model', this.authMethod, {
|
||||
const canList = this.abilities.can('list model', this.authMethod, {
|
||||
collection: 'accounts',
|
||||
});
|
||||
const canCreate = this.can.can('create model', this.authMethod, {
|
||||
const canCreate = this.abilities.can('create model', this.authMethod, {
|
||||
collection: 'accounts',
|
||||
});
|
||||
const resource = this.intl.t('resources.account.title_plural');
|
||||
@@ -80,7 +80,7 @@ export default class ScopesScopeAuthMethodsAuthMethodAccountsIndexController ext
|
||||
adapterOptions.password = password;
|
||||
}
|
||||
await account.save({ adapterOptions });
|
||||
if (this.can.can('read model', account)) {
|
||||
if (this.abilities.can('read model', account)) {
|
||||
await this.router.transitionTo(
|
||||
'scopes.scope.auth-methods.auth-method.accounts.account',
|
||||
account,
|
||||
|
||||
+4
-4
@@ -15,7 +15,7 @@ export default class ScopesScopeAuthMethodsAuthMethodManagedGroupsIndexControlle
|
||||
|
||||
// =services
|
||||
|
||||
@service can;
|
||||
@service abilities;
|
||||
@service intl;
|
||||
@service router;
|
||||
|
||||
@@ -28,10 +28,10 @@ export default class ScopesScopeAuthMethodsAuthMethodManagedGroupsIndexControlle
|
||||
* @type {string}
|
||||
*/
|
||||
get messageDescription() {
|
||||
const canList = this.can.can('list model', this.authMethod, {
|
||||
const canList = this.abilities.can('list model', this.authMethod, {
|
||||
collection: 'managed-groups',
|
||||
});
|
||||
const canCreate = this.can.can('create model', this.authMethod, {
|
||||
const canCreate = this.abilities.can('create model', this.authMethod, {
|
||||
collection: 'managed-groups',
|
||||
});
|
||||
const resource = this.intl.t('resources.managed-group.title_plural');
|
||||
@@ -75,7 +75,7 @@ export default class ScopesScopeAuthMethodsAuthMethodManagedGroupsIndexControlle
|
||||
)
|
||||
async save(managedGroup) {
|
||||
await managedGroup.save();
|
||||
if (this.can.can('read model', managedGroup)) {
|
||||
if (this.abilities.can('read model', managedGroup)) {
|
||||
await this.router.transitionTo(
|
||||
'scopes.scope.auth-methods.auth-method.managed-groups.managed-group',
|
||||
managedGroup,
|
||||
|
||||
@@ -16,7 +16,7 @@ export default class ScopesScopeAuthMethodsIndexController extends Controller {
|
||||
// =services
|
||||
|
||||
@service router;
|
||||
@service can;
|
||||
@service abilities;
|
||||
@service intl;
|
||||
@service store;
|
||||
|
||||
@@ -82,10 +82,10 @@ export default class ScopesScopeAuthMethodsIndexController extends Controller {
|
||||
* @type {string}
|
||||
*/
|
||||
get messageDescription() {
|
||||
const canList = this.can.can('list model', this.scopeModel, {
|
||||
const canList = this.abilities.can('list model', this.scopeModel, {
|
||||
collection: 'auth-methods',
|
||||
});
|
||||
const canCreate = this.can.can('create model', this.scopeModel, {
|
||||
const canCreate = this.abilities.can('create model', this.scopeModel, {
|
||||
collection: 'auth-methods',
|
||||
});
|
||||
const resource = this.intl.t('resources.auth-method.title_plural');
|
||||
@@ -148,7 +148,7 @@ export default class ScopesScopeAuthMethodsIndexController extends Controller {
|
||||
)
|
||||
async save(authMethod) {
|
||||
await authMethod.save();
|
||||
if (this.can.can('read model', authMethod)) {
|
||||
if (this.abilities.can('read model', authMethod)) {
|
||||
await this.router.transitionTo(
|
||||
'scopes.scope.auth-methods.auth-method',
|
||||
authMethod,
|
||||
|
||||
+4
-4
@@ -15,7 +15,7 @@ export default class ScopesScopeCredentialStoresCredentialStoreCredentialLibrari
|
||||
|
||||
// =services
|
||||
|
||||
@service can;
|
||||
@service abilities;
|
||||
@service intl;
|
||||
@service router;
|
||||
|
||||
@@ -28,10 +28,10 @@ export default class ScopesScopeCredentialStoresCredentialStoreCredentialLibrari
|
||||
* @type {string}
|
||||
*/
|
||||
get messageDescription() {
|
||||
const canList = this.can.can('list model', this.credentialStore, {
|
||||
const canList = this.abilities.can('list model', this.credentialStore, {
|
||||
collection: 'credential-libraries',
|
||||
});
|
||||
const canCreate = this.can.can('create model', this.credentialStore, {
|
||||
const canCreate = this.abilities.can('create model', this.credentialStore, {
|
||||
collection: 'credential-libraries',
|
||||
});
|
||||
const resource = this.intl.t('resources.credential-library.title_plural');
|
||||
@@ -75,7 +75,7 @@ export default class ScopesScopeCredentialStoresCredentialStoreCredentialLibrari
|
||||
)
|
||||
async save(credentialLibrary) {
|
||||
await credentialLibrary.save();
|
||||
if (this.can.can('read model', credentialLibrary)) {
|
||||
if (this.abilities.can('read model', credentialLibrary)) {
|
||||
await this.router.transitionTo(
|
||||
'scopes.scope.credential-stores.credential-store.credential-libraries.credential-library',
|
||||
credentialLibrary,
|
||||
|
||||
+4
-4
@@ -15,7 +15,7 @@ export default class ScopesScopeCredentialStoresCredentialStoreCredentialsIndexC
|
||||
|
||||
// =services
|
||||
|
||||
@service can;
|
||||
@service abilities;
|
||||
@service intl;
|
||||
@service router;
|
||||
|
||||
@@ -28,10 +28,10 @@ export default class ScopesScopeCredentialStoresCredentialStoreCredentialsIndexC
|
||||
* @type {string}
|
||||
*/
|
||||
get messageDescription() {
|
||||
const canList = this.can.can('list model', this.credentialStore, {
|
||||
const canList = this.abilities.can('list model', this.credentialStore, {
|
||||
collection: 'credentials',
|
||||
});
|
||||
const canCreate = this.can.can('create model', this.credentialStore, {
|
||||
const canCreate = this.abilities.can('create model', this.credentialStore, {
|
||||
collection: 'credentials',
|
||||
});
|
||||
const resource = this.intl.t('resources.credential.title_plural');
|
||||
@@ -75,7 +75,7 @@ export default class ScopesScopeCredentialStoresCredentialStoreCredentialsIndexC
|
||||
)
|
||||
async save(credential) {
|
||||
await credential.save();
|
||||
if (this.can.can('read credential', credential)) {
|
||||
if (this.abilities.can('read credential', credential)) {
|
||||
await this.router.transitionTo(
|
||||
'scopes.scope.credential-stores.credential-store.credentials.credential',
|
||||
credential,
|
||||
|
||||
@@ -15,7 +15,7 @@ import { TYPES_CREDENTIAL_STORE } from 'api/models/credential-store';
|
||||
export default class ScopesScopeCredentialStoresIndexController extends Controller {
|
||||
// =services
|
||||
|
||||
@service can;
|
||||
@service abilities;
|
||||
@service router;
|
||||
@service intl;
|
||||
|
||||
@@ -58,10 +58,10 @@ export default class ScopesScopeCredentialStoresIndexController extends Controll
|
||||
* @type {string}
|
||||
*/
|
||||
get messageDescription() {
|
||||
const canList = this.can.can('list model', this.scope, {
|
||||
const canList = this.abilities.can('list model', this.scope, {
|
||||
collection: 'credential-stores',
|
||||
});
|
||||
const canCreate = this.can.can('create model', this.scope, {
|
||||
const canCreate = this.abilities.can('create model', this.scope, {
|
||||
collection: 'credential-stores',
|
||||
});
|
||||
const resource = this.intl.t('resources.credential-store.title_plural');
|
||||
@@ -88,7 +88,7 @@ export default class ScopesScopeCredentialStoresIndexController extends Controll
|
||||
@notifySuccess('notifications.save-success')
|
||||
async save(credentialStore) {
|
||||
await credentialStore.save();
|
||||
if (this.can.can('read model', credentialStore)) {
|
||||
if (this.abilities.can('read model', credentialStore)) {
|
||||
await this.router.transitionTo(
|
||||
'scopes.scope.credential-stores.credential-store',
|
||||
credentialStore,
|
||||
|
||||
@@ -14,7 +14,7 @@ import { notifySuccess, notifyError } from 'core/decorators/notify';
|
||||
export default class ScopesScopeGroupsIndexController extends Controller {
|
||||
// =services
|
||||
|
||||
@service can;
|
||||
@service abilities;
|
||||
@service intl;
|
||||
@service router;
|
||||
|
||||
@@ -41,10 +41,10 @@ export default class ScopesScopeGroupsIndexController extends Controller {
|
||||
* @type {string}
|
||||
*/
|
||||
get messageDescription() {
|
||||
const canList = this.can.can('list model', this.scope, {
|
||||
const canList = this.abilities.can('list model', this.scope, {
|
||||
collection: 'groups',
|
||||
});
|
||||
const canCreate = this.can.can('create model', this.scope, {
|
||||
const canCreate = this.abilities.can('create model', this.scope, {
|
||||
collection: 'groups',
|
||||
});
|
||||
const resource = this.intl.t('resources.group.title_plural');
|
||||
@@ -84,7 +84,7 @@ export default class ScopesScopeGroupsIndexController extends Controller {
|
||||
)
|
||||
async save(group) {
|
||||
await group.save();
|
||||
if (this.can.can('read model', group)) {
|
||||
if (this.abilities.can('read model', group)) {
|
||||
await this.router.transitionTo('scopes.scope.groups.group', group);
|
||||
} else {
|
||||
this.router.transitionTo('scopes.scope.groups');
|
||||
|
||||
@@ -15,7 +15,7 @@ export default class ScopesScopeHostCatalogsHostCatalogHostSetsIndexController e
|
||||
|
||||
// =services
|
||||
|
||||
@service can;
|
||||
@service abilities;
|
||||
@service intl;
|
||||
@service router;
|
||||
@service store;
|
||||
@@ -29,10 +29,10 @@ export default class ScopesScopeHostCatalogsHostCatalogHostSetsIndexController e
|
||||
* @type {string}
|
||||
*/
|
||||
get messageDescription() {
|
||||
const canList = this.can.can('list model', this.hostCatalog, {
|
||||
const canList = this.abilities.can('list model', this.hostCatalog, {
|
||||
collection: 'host-sets',
|
||||
});
|
||||
const canCreate = this.can.can('create model', this.hostCatalog, {
|
||||
const canCreate = this.abilities.can('create model', this.hostCatalog, {
|
||||
collection: 'host-sets',
|
||||
});
|
||||
const resource = this.intl.t('resources.host-set.title_plural');
|
||||
@@ -79,7 +79,7 @@ export default class ScopesScopeHostCatalogsHostCatalogHostSetsIndexController e
|
||||
// Fetch newest host set as updates to host set attributes cause an async db update which
|
||||
// updates the version again and can cause a version mismatch if the host set is updated
|
||||
// again and we haven't fetched the newest version.
|
||||
if (this.can.can('read host-set', hostSet)) {
|
||||
if (this.abilities.can('read host-set', hostSet)) {
|
||||
const newestHostSet = await this.store.findRecord(
|
||||
'host-set',
|
||||
hostSet.id,
|
||||
@@ -93,7 +93,7 @@ export default class ScopesScopeHostCatalogsHostCatalogHostSetsIndexController e
|
||||
|
||||
await hostSet.save();
|
||||
|
||||
if (this.can.can('read host-set', hostSet)) {
|
||||
if (this.abilities.can('read host-set', hostSet)) {
|
||||
await this.router.transitionTo(
|
||||
'scopes.scope.host-catalogs.host-catalog.host-sets.host-set',
|
||||
hostSet,
|
||||
|
||||
@@ -15,7 +15,7 @@ export default class ScopesScopeHostCatalogsHostCatalogHostsIndexController exte
|
||||
|
||||
// =services
|
||||
|
||||
@service can;
|
||||
@service abilities;
|
||||
@service intl;
|
||||
@service router;
|
||||
|
||||
@@ -28,10 +28,10 @@ export default class ScopesScopeHostCatalogsHostCatalogHostsIndexController exte
|
||||
* @type {string}
|
||||
*/
|
||||
get messageDescription() {
|
||||
const canList = this.can.can('list model', this.hostCatalog, {
|
||||
const canList = this.abilities.can('list model', this.hostCatalog, {
|
||||
collection: 'hosts',
|
||||
});
|
||||
const canCreate = this.can.can('create model', this.hostCatalog, {
|
||||
const canCreate = this.abilities.can('create model', this.hostCatalog, {
|
||||
collection: 'hosts',
|
||||
});
|
||||
const resource = this.intl.t('resources.host.title_plural');
|
||||
@@ -74,7 +74,7 @@ export default class ScopesScopeHostCatalogsHostCatalogHostsIndexController exte
|
||||
)
|
||||
async save(host) {
|
||||
await host.save();
|
||||
if (this.can.can('read model', host)) {
|
||||
if (this.abilities.can('read model', host)) {
|
||||
await this.router.transitionTo(
|
||||
'scopes.scope.host-catalogs.host-catalog.hosts.host',
|
||||
host,
|
||||
|
||||
@@ -15,7 +15,7 @@ import { TYPE_CREDENTIAL_STATIC } from 'api/models/host-catalog';
|
||||
export default class ScopesScopeHostCatalogsIndexController extends Controller {
|
||||
// =services
|
||||
|
||||
@service can;
|
||||
@service abilities;
|
||||
@service intl;
|
||||
@service router;
|
||||
|
||||
@@ -42,10 +42,10 @@ export default class ScopesScopeHostCatalogsIndexController extends Controller {
|
||||
* @type {string}
|
||||
*/
|
||||
get messageDescription() {
|
||||
const canList = this.can.can('list model', this.scope, {
|
||||
const canList = this.abilities.can('list model', this.scope, {
|
||||
collection: 'host-catalogs',
|
||||
});
|
||||
const canCreate = this.can.can('create model', this.scope, {
|
||||
const canCreate = this.abilities.can('create model', this.scope, {
|
||||
collection: 'host-catalogs',
|
||||
});
|
||||
const resource = this.intl.t('resources.host-catalog.title_plural');
|
||||
@@ -101,7 +101,7 @@ export default class ScopesScopeHostCatalogsIndexController extends Controller {
|
||||
hostCatalog.credentialType = TYPE_CREDENTIAL_STATIC;
|
||||
}
|
||||
await hostCatalog.save();
|
||||
if (this.can.can('read host-catalog', hostCatalog)) {
|
||||
if (this.abilities.can('read host-catalog', hostCatalog)) {
|
||||
await this.router.transitionTo(
|
||||
'scopes.scope.host-catalogs.host-catalog',
|
||||
hostCatalog,
|
||||
|
||||
@@ -13,7 +13,7 @@ import { notifySuccess, notifyError } from 'core/decorators/notify';
|
||||
export default class ScopesScopePoliciesIndexController extends Controller {
|
||||
// =services
|
||||
|
||||
@service can;
|
||||
@service abilities;
|
||||
@service intl;
|
||||
@service router;
|
||||
|
||||
@@ -26,10 +26,10 @@ export default class ScopesScopePoliciesIndexController extends Controller {
|
||||
* @type {string}
|
||||
*/
|
||||
get messageDescription() {
|
||||
const canList = this.can.can('list model', this.scope, {
|
||||
const canList = this.abilities.can('list model', this.scope, {
|
||||
collection: 'policies',
|
||||
});
|
||||
const canCreate = this.can.can('create model', this.scope, {
|
||||
const canCreate = this.abilities.can('create model', this.scope, {
|
||||
collection: 'policies',
|
||||
});
|
||||
const resource = this.intl.t('resources.policy.title_plural');
|
||||
@@ -67,7 +67,7 @@ export default class ScopesScopePoliciesIndexController extends Controller {
|
||||
@notifySuccess('notifications.save-success')
|
||||
async save(policy) {
|
||||
await policy.save();
|
||||
if (this.can.can('read model', policy)) {
|
||||
if (this.abilities.can('read model', policy)) {
|
||||
await this.router.transitionTo('scopes.scope.policies.policy', policy);
|
||||
} else {
|
||||
await this.router.transitionTo('scopes.scope.policies');
|
||||
|
||||
@@ -15,7 +15,7 @@ import { GRANT_SCOPE_THIS } from 'api/models/role';
|
||||
export default class ScopesScopeRolesIndexController extends Controller {
|
||||
// =services
|
||||
|
||||
@service can;
|
||||
@service abilities;
|
||||
@service intl;
|
||||
@service router;
|
||||
|
||||
@@ -44,10 +44,10 @@ export default class ScopesScopeRolesIndexController extends Controller {
|
||||
* @type {string}
|
||||
*/
|
||||
get messageDescription() {
|
||||
const canList = this.can.can('list model', this.scope, {
|
||||
const canList = this.abilities.can('list model', this.scope, {
|
||||
collection: 'roles',
|
||||
});
|
||||
const canCreate = this.can.can('create model', this.scope, {
|
||||
const canCreate = this.abilities.can('create model', this.scope, {
|
||||
collection: 'roles',
|
||||
});
|
||||
const resource = this.intl.t('resources.role.title_plural');
|
||||
@@ -98,7 +98,7 @@ export default class ScopesScopeRolesIndexController extends Controller {
|
||||
)
|
||||
async save(role) {
|
||||
await role.save();
|
||||
if (this.can.can('read model', role)) {
|
||||
if (this.abilities.can('read model', role)) {
|
||||
await this.router.transitionTo('scopes.scope.roles.role', role);
|
||||
} else {
|
||||
this.router.transitionTo('scopes.scope.roles');
|
||||
|
||||
@@ -14,7 +14,7 @@ import { TYPE_CREDENTIAL_STATIC } from 'api/models/storage-bucket';
|
||||
export default class ScopesScopeStorageBucketsIndexController extends Controller {
|
||||
// =services
|
||||
|
||||
@service can;
|
||||
@service abilities;
|
||||
@service intl;
|
||||
@service router;
|
||||
|
||||
@@ -27,10 +27,10 @@ export default class ScopesScopeStorageBucketsIndexController extends Controller
|
||||
* @type {string}
|
||||
*/
|
||||
get messageDescription() {
|
||||
const canList = this.can.can('list scope', this.scope, {
|
||||
const canList = this.abilities.can('list scope', this.scope, {
|
||||
collection: 'storage-buckets',
|
||||
});
|
||||
const canCreate = this.can.can('create scope', this.scope, {
|
||||
const canCreate = this.abilities.can('create scope', this.scope, {
|
||||
collection: 'storage-buckets',
|
||||
});
|
||||
const resource = this.intl.t('resources.storage-bucket.title_plural');
|
||||
|
||||
@@ -20,7 +20,7 @@ export default class ScopesScopeTargetsIndexController extends Controller {
|
||||
// =services
|
||||
|
||||
@service intl;
|
||||
@service can;
|
||||
@service abilities;
|
||||
@service router;
|
||||
@service confirm;
|
||||
@service features;
|
||||
@@ -80,10 +80,10 @@ export default class ScopesScopeTargetsIndexController extends Controller {
|
||||
* @type {string}
|
||||
*/
|
||||
get messageDescription() {
|
||||
const canList = this.can.can('list model', this.scope, {
|
||||
const canList = this.abilities.can('list model', this.scope, {
|
||||
collection: 'targets',
|
||||
});
|
||||
const canCreate = this.can.can('create model', this.scope, {
|
||||
const canCreate = this.abilities.can('create model', this.scope, {
|
||||
collection: 'targets',
|
||||
});
|
||||
const resource = this.intl.t('resources.target.title_plural');
|
||||
@@ -187,7 +187,7 @@ export default class ScopesScopeTargetsIndexController extends Controller {
|
||||
)
|
||||
async save(target) {
|
||||
await target.save();
|
||||
if (this.can.can('read model', target)) {
|
||||
if (this.abilities.can('read model', target)) {
|
||||
await this.router.transitionTo('scopes.scope.targets.target', target);
|
||||
} else {
|
||||
this.router.transitionTo('scopes.scope.targets');
|
||||
|
||||
@@ -13,7 +13,7 @@ export default class ScopesScopeTargetsTargetIndexController extends Controller
|
||||
|
||||
// =services
|
||||
|
||||
@service can;
|
||||
@service abilities;
|
||||
@service router;
|
||||
|
||||
// =attributes
|
||||
|
||||
@@ -14,7 +14,7 @@ import { notifySuccess, notifyError } from 'core/decorators/notify';
|
||||
export default class ScopesScopeUsersIndexController extends Controller {
|
||||
// =services
|
||||
|
||||
@service can;
|
||||
@service abilities;
|
||||
@service intl;
|
||||
@service router;
|
||||
@tracked sortAttribute;
|
||||
@@ -41,10 +41,10 @@ export default class ScopesScopeUsersIndexController extends Controller {
|
||||
* @type {string}
|
||||
*/
|
||||
get messageDescription() {
|
||||
const canList = this.can.can('list model', this.scope, {
|
||||
const canList = this.abilities.can('list model', this.scope, {
|
||||
collection: 'users',
|
||||
});
|
||||
const canCreate = this.can.can('create model', this.scope, {
|
||||
const canCreate = this.abilities.can('create model', this.scope, {
|
||||
collection: 'users',
|
||||
});
|
||||
const resource = this.intl.t('resources.user.title_plural');
|
||||
@@ -98,7 +98,7 @@ export default class ScopesScopeUsersIndexController extends Controller {
|
||||
)
|
||||
async save(user) {
|
||||
await user.save();
|
||||
if (this.can.can('read model', user)) {
|
||||
if (this.abilities.can('read model', user)) {
|
||||
await this.router.transitionTo('scopes.scope.users.user', user);
|
||||
} else {
|
||||
this.router.transitionTo('scopes.scope.users');
|
||||
|
||||
@@ -14,7 +14,7 @@ import { notifySuccess, notifyError } from 'core/decorators/notify';
|
||||
export default class ScopesScopeWorkersIndexController extends Controller {
|
||||
// =services
|
||||
|
||||
@service can;
|
||||
@service abilities;
|
||||
@service intl;
|
||||
@service router;
|
||||
|
||||
@@ -79,12 +79,16 @@ export default class ScopesScopeWorkersIndexController extends Controller {
|
||||
* @type {string}
|
||||
*/
|
||||
get messageDescription() {
|
||||
const canList = this.can.can('list worker', this.scope, {
|
||||
collection: 'workers',
|
||||
});
|
||||
const canCreate = this.can.can('create worker led worker', this.scope, {
|
||||
const canList = this.abilities.can('list worker', this.scope, {
|
||||
collection: 'workers',
|
||||
});
|
||||
const canCreate = this.abilities.can(
|
||||
'create worker led worker',
|
||||
this.scope,
|
||||
{
|
||||
collection: 'workers',
|
||||
},
|
||||
);
|
||||
const resource = this.intl.t('titles.workers');
|
||||
let description = 'descriptions.neither-list-nor-create';
|
||||
|
||||
@@ -159,7 +163,7 @@ export default class ScopesScopeWorkersIndexController extends Controller {
|
||||
)
|
||||
async save(worker) {
|
||||
await worker.save();
|
||||
if (this.can.can('read model', worker)) {
|
||||
if (this.abilities.can('read model', worker)) {
|
||||
await this.router.transitionTo('scopes.scope.workers.worker', worker);
|
||||
} else {
|
||||
this.router.transitionTo('scopes.scope.workers');
|
||||
|
||||
Reference in new issue
Block a user