Fixed technicianFullDataAccess
All checks were successful
Deploy dev on push / on-push-deploy_sh-edraft (push) Successful in 3m59s
All checks were successful
Deploy dev on push / on-push-deploy_sh-edraft (push) Successful in 3m59s
This commit is contained in:
parent
23a3dbbc5e
commit
2f161d2f43
@ -18,6 +18,7 @@ import { Mutations } from "../../../../models/graphql/mutations.model";
|
|||||||
import { MenuItem } from "primeng/api";
|
import { MenuItem } from "primeng/api";
|
||||||
import { UserWarning } from "../../../../models/data/user_warning.model";
|
import { UserWarning } from "../../../../models/data/user_warning.model";
|
||||||
import moment from "moment";
|
import moment from "moment";
|
||||||
|
import { SidebarService } from "../../../../services/sidebar/sidebar.service";
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: "app-profile",
|
selector: "app-profile",
|
||||||
@ -34,6 +35,7 @@ export class ProfileComponent implements OnInit, OnDestroy {
|
|||||||
public isEditingNewUserWarning: boolean = false;
|
public isEditingNewUserWarning: boolean = false;
|
||||||
public isEditing: boolean = false;
|
public isEditing: boolean = false;
|
||||||
public isModerator: boolean = false;
|
public isModerator: boolean = false;
|
||||||
|
public hasTechnicianAccess: boolean = false;
|
||||||
|
|
||||||
private unsubscriber = new Subject<void>();
|
private unsubscriber = new Subject<void>();
|
||||||
|
|
||||||
@ -45,7 +47,8 @@ export class ProfileComponent implements OnInit, OnDestroy {
|
|||||||
private auth: AuthService,
|
private auth: AuthService,
|
||||||
private toast: ToastService,
|
private toast: ToastService,
|
||||||
private translate: TranslateService,
|
private translate: TranslateService,
|
||||||
private toastService: ToastService
|
private toastService: ToastService,
|
||||||
|
private sidebarService: SidebarService,
|
||||||
) {
|
) {
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -78,7 +81,8 @@ export class ProfileComponent implements OnInit, OnDestroy {
|
|||||||
let authUser = await this.auth.getLoggedInUser();
|
let authUser = await this.auth.getLoggedInUser();
|
||||||
this.spinner.showSpinner();
|
this.spinner.showSpinner();
|
||||||
let user: UserDTO | null = authUser?.users?.find(u => u.server == server.id) ?? null;
|
let user: UserDTO | null = authUser?.users?.find(u => u.server == server.id) ?? null;
|
||||||
if (!user || user?.id != params["memberId"] && !user?.isModerator) {
|
this.hasTechnicianAccess = (this.sidebarService.hasFeature("TechnicianFullAccess") && user?.isTechnician) ?? false;
|
||||||
|
if (!user || user?.id != params["memberId"] && !user?.isModerator && !this.hasTechnicianAccess) {
|
||||||
this.toast.error(this.translate.instant("view.server.profile.permission_denied"), this.translate.instant("view.server.profile.permission_denied_d"));
|
this.toast.error(this.translate.instant("view.server.profile.permission_denied"), this.translate.instant("view.server.profile.permission_denied_d"));
|
||||||
this.spinner.hideSpinner();
|
this.spinner.hideSpinner();
|
||||||
await this.router.navigate(["/server", server.id]);
|
await this.router.navigate(["/server", server.id]);
|
||||||
|
Loading…
Reference in New Issue
Block a user