diff --git a/frontend/app/abilities/absence-credit.js b/frontend/app/abilities/absence-credit.js index d9854c282..c8cea5d7c 100644 --- a/frontend/app/abilities/absence-credit.js +++ b/frontend/app/abilities/absence-credit.js @@ -2,10 +2,10 @@ import { inject as service } from "@ember/service"; import { Ability } from "ember-can"; export default class AbsenceCreditAbility extends Ability { - @service session; + @service currentUser; get user() { - return this.session.data.user; + return this.currentUser.user; } get canEdit() { return this.user.isSuperuser; diff --git a/frontend/app/abilities/overtime-credit.js b/frontend/app/abilities/overtime-credit.js index 5c14354ca..040f38b39 100644 --- a/frontend/app/abilities/overtime-credit.js +++ b/frontend/app/abilities/overtime-credit.js @@ -2,10 +2,10 @@ import { inject as service } from "@ember/service"; import { Ability } from "ember-can"; export default class OvertimeCreditAbility extends Ability { - @service session; + @service currentUser; get user() { - return this.session.data.user; + return this.currentUser.user; } get canEdit() { return this.user.isSuperuser; diff --git a/frontend/app/abilities/page.js b/frontend/app/abilities/page.js index 557c9d27c..133f00e66 100644 --- a/frontend/app/abilities/page.js +++ b/frontend/app/abilities/page.js @@ -2,10 +2,10 @@ import { inject as service } from "@ember/service"; import { Ability } from "ember-can"; export default class PageAbility extends Ability { - @service session; + @service currentUser; get user() { - return this.session.data.user; + return this.currentUser.user; } get canAccess() { if (!this.user) { diff --git a/frontend/app/abilities/report.js b/frontend/app/abilities/report.js index b68eed970..a80212e06 100644 --- a/frontend/app/abilities/report.js +++ b/frontend/app/abilities/report.js @@ -2,10 +2,10 @@ import { inject as service } from "@ember/service"; import { Ability } from "ember-can"; export default class ReportAbility extends Ability { - @service session; + @service currentUser; get user() { - return this.session.data.user; + return this.currentUser.user; } get canEdit() { diff --git a/frontend/app/abilities/user.js b/frontend/app/abilities/user.js index f7706a942..ada672a13 100644 --- a/frontend/app/abilities/user.js +++ b/frontend/app/abilities/user.js @@ -2,10 +2,10 @@ import { inject as service } from "@ember/service"; import { Ability } from "ember-can"; export default class UserAbility extends Ability { - @service session; + @service currentUser; get user() { - return this.session.data.user; + return this.currentUser.user; } get canRead() { diff --git a/frontend/app/analysis/edit/controller.js b/frontend/app/analysis/edit/controller.js index 290e7cfd6..e8fe3a2da 100644 --- a/frontend/app/analysis/edit/controller.js +++ b/frontend/app/analysis/edit/controller.js @@ -55,7 +55,7 @@ export default class AnalysisEditController extends Controller { @service notify; @service router; @service fetch; - @service session; + @service currentUser; @service store; @service unverifiedReports; @@ -86,11 +86,11 @@ export default class AnalysisEditController extends Controller { } get isAccountant() { - return this.session.data.user.isAccountant; + return this.currentUser.user.isAccountant; } get isSuperuser() { - return this.session.data.user.isSuperuser; + return this.currentUser.user.isSuperuser; } @task @@ -130,11 +130,11 @@ export default class AnalysisEditController extends Controller { } get hasSelectedOwnReports() { - return this.intersectionModel.user.get("id") === this.session.data.user.id; + return this.intersectionModel.user.get("id") === this.currentUser.user.id; } get isReviewer() { - return allQueryParams(this).reviewer === this.session.data.user.id; + return allQueryParams(this).reviewer === this.currentUser.user.id; } get canVerify() { diff --git a/frontend/app/analysis/index/controller.js b/frontend/app/analysis/index/controller.js index 2b7c1f662..5eb454d04 100644 --- a/frontend/app/analysis/index/controller.js +++ b/frontend/app/analysis/index/controller.js @@ -50,6 +50,7 @@ export default class AnalysisController extends QPController { exportLimit = config.APP.EXPORT_LIMIT; @service session; + @service currentUser; @service store; @service router; @service notify; @@ -119,7 +120,7 @@ export default class AnalysisController extends QPController { get canBill() { return ( - this.session.data.user.isAccountant || this.session.data.user.isSuperuser + this.currentUser.user.isAccountant || this.currentUser.user.isSuperuser ); } diff --git a/frontend/app/components/report-review-warning/component.js b/frontend/app/components/report-review-warning/component.js index c168de6cb..93bc3310d 100644 --- a/frontend/app/components/report-review-warning/component.js +++ b/frontend/app/components/report-review-warning/component.js @@ -2,7 +2,7 @@ import { inject as service } from "@ember/service"; import Component from "@glimmer/component"; export default class ReportReviewWarning extends Component { - @service session; + @service currentUser; @service unverifiedReports; diff --git a/frontend/app/components/report-review-warning/template.hbs b/frontend/app/components/report-review-warning/template.hbs index efff3fa52..deb5b2ba1 100644 --- a/frontend/app/components/report-review-warning/template.hbs +++ b/frontend/app/components/report-review-warning/template.hbs @@ -8,7 +8,7 @@ toDate=(moment-format this.unverifiedReports.reportsToDate "YYYY-MM-DD" ) - reviewer=this.session.data.user.id + reviewer=this.currentUser.user.id editable=1 rejected=null verified=0 @@ -34,7 +34,7 @@ @query={{hash fromDate=null toDate=null - user=this.session.data.user.id + user=this.currentUser.user.id editable=1 rejected=1 verified=0 diff --git a/frontend/app/components/sy-topnav/component.js b/frontend/app/components/sy-topnav/component.js index c73f531d6..c879d4c41 100644 --- a/frontend/app/components/sy-topnav/component.js +++ b/frontend/app/components/sy-topnav/component.js @@ -3,7 +3,7 @@ import Component from "@glimmer/component"; import { tracked } from "@glimmer/tracking"; export default class SyTopnav extends Component { - @service session; + @service currentUser; @service media; diff --git a/frontend/app/components/sy-topnav/template.hbs b/frontend/app/components/sy-topnav/template.hbs index 379ec5ea9..5662fd1a2 100644 --- a/frontend/app/components/sy-topnav/template.hbs +++ b/frontend/app/components/sy-topnav/template.hbs @@ -47,7 +47,7 @@ {{/if}} {{/unless}} - {{#if this.session.data.user.isSuperuser}} + {{#if this.currentUser.user.isSuperuser}}