-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
58 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,16 @@ | ||
import Route from '@ember/routing/route'; | ||
import { inject as service } from '@ember/service'; | ||
|
||
export default class GroupsRoute extends Route {} | ||
export default class GroupsRoute extends Route { | ||
@service abilities; | ||
@service notifications; | ||
@service hostRouter; | ||
@service intl; | ||
|
||
beforeModel() { | ||
if (this.abilities.cannot('iam list group')) { | ||
this.notifications.warning(this.intl.t('common.unauthorized-access')); | ||
return this.hostRouter.transitionTo('console.iam.home'); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,3 @@ | ||
import Route from '@ember/routing/route'; | ||
import { inject as service } from '@ember/service'; | ||
|
||
export default class HomeRoute extends Route { | ||
@service fetch; | ||
|
||
model() { | ||
return this.fetch.get('metrics/iam'); | ||
} | ||
} | ||
export default class HomeRoute extends Route {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,16 @@ | ||
import Route from '@ember/routing/route'; | ||
import { inject as service } from '@ember/service'; | ||
|
||
export default class PoliciesRoute extends Route {} | ||
export default class PoliciesRoute extends Route { | ||
@service abilities; | ||
@service notifications; | ||
@service hostRouter; | ||
@service intl; | ||
|
||
beforeModel() { | ||
if (this.abilities.cannot('iam list policy')) { | ||
this.notifications.warning(this.intl.t('common.unauthorized-access')); | ||
return this.hostRouter.transitionTo('console.iam.home'); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,16 @@ | ||
import Route from '@ember/routing/route'; | ||
import { inject as service } from '@ember/service'; | ||
|
||
export default class RolesRoute extends Route {} | ||
export default class RolesRoute extends Route { | ||
@service abilities; | ||
@service notifications; | ||
@service hostRouter; | ||
@service intl; | ||
|
||
beforeModel() { | ||
if (this.abilities.cannot('iam list role')) { | ||
this.notifications.warning(this.intl.t('common.unauthorized-access')); | ||
return this.hostRouter.transitionTo('console.iam.home'); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,16 @@ | ||
import Route from '@ember/routing/route'; | ||
import { inject as service } from '@ember/service'; | ||
|
||
export default class UsersRoute extends Route {} | ||
export default class UsersRoute extends Route { | ||
@service abilities; | ||
@service notifications; | ||
@service hostRouter; | ||
@service intl; | ||
|
||
beforeModel() { | ||
if (this.abilities.cannot('iam list user')) { | ||
this.notifications.warning(this.intl.t('common.unauthorized-access')); | ||
return this.hostRouter.transitionTo('console.iam.home'); | ||
} | ||
} | ||
} |