import { Inject, Injectable } from '@angular/core'; import 'rxjs/Rx'; import { Profile_CONSTANTS } from '../shared/profile.constants'; @Injectable() export class ManageRoleListService { private environment: any; constructor(@Inject(Profile_CONSTANTS) private constants) { } public setEnvironment = (environment: any) => { this.environment = environment; } public getTenantUrl() { return `${this.environment.TENANT_SERVICE_URL}/tenant/active/true` } public getCampusUrl(TenantCode) { return `${this.environment.TENANT_SERVICE_URL}/tenant/${TenantCode}/active/true` } public getProfileAdminConfig(campusCode) { return { roleName: this.constants.roles.EHSAdmin.text, roleValue: this.constants.roles.EHSAdmin.value, roleDescription: this.constants.roles.EHSAdmin.description, campus: campusCode } } // public getProceduresAdminRoleConfig(campusCode) { // return { // roleName: this.constants.roles.ProceduresAdminRole.text, // roleValue: this.constants.roles.ProceduresAdminRole.value, // roleDescription: this.constants.roles.ProceduresAdminRole.description, // campus: campusCode // } // } // public getProceduresTemplateAdminRoleConfig(campusCode) { // return { // roleName: this.constants.roles.ProceduresTemplateAdminRole.text, // roleValue: this.constants.roles.ProceduresTemplateAdminRole.value, // roleDescription: this.constants.roles.ProceduresTemplateAdminRole.description, // campus: campusCode // } // } public getServiceDeskConfig(campusCode) { return { roleName: this.constants.roles.ServiceDesk.text, roleValue: this.constants.roles.ServiceDesk.value, roleDescription: this.constants.roles.ServiceDesk.description, campus: campusCode } } public getManageRolesConfig(campusCode, role) { return { roleName: role.text, roleValue: role.value, roleDescription: role.description, campus: campusCode } } public getCollectionsAdminConfig(campusCode) { return { roleName: this.constants.roles.CollectionsAdmin.text, roleValue: this.constants.roles.CollectionsAdmin.value, roleDescription: this.constants.roles.CollectionsAdmin.description, campus: campusCode } } public getFacilitiesManagerConfig(campusCode) { return { roleName: this.constants.roles.FacilitiesManager.text, roleValue: this.constants.roles.FacilitiesManager.value, roleDescription: this.constants.roles.FacilitiesManager.description, campus: campusCode } } }