summaryrefslogtreecommitdiffstats
path: root/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/security/security.service.ts
blob: fd4abfb686798dd4bb5edc5fbd8efc98a985a8a4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
import { Injectable } from '@angular/core';
import { HttpClient, HttpHeaders } from '@angular/common/http';
import { environment } from '../../../../../../environments/environment';
import { Observable } from 'rxjs';



@Injectable({
  providedIn: 'root'
})
export class SecurityService {

  constructor(private _http : HttpClient) { }

  getReportOwnerList() : Observable<any>
  {
    return this._http.get(environment.baseUrl + "report/wizard/security/retrieveReportOwner");
    // return this._http.get("https://e911.dev.att.com/enmt/report/wizard/security/retrieveReportOwner");
  }

  getReportRoleList() : Observable<any>
  {
    return this._http.get(environment.baseUrl + "report/wizard/security/retrieveReportRoleList");
    // return this._http.get("https://e911.dev.att.com/enmt/report/wizard/security/retrieveReportRoleList");
  }

  getReportSecurityInfo() : Observable<any>
  {
    return this._http.get(environment.baseUrl + "report/wizard/security/getReportSecurityInfo");
    // return this._http.get("https://e911.dev.att.com/enmt/report/wizard/security/getReportSecurityInfo");
  }

  getReportUserList() : Observable<any>
  {
    return this._http.get(environment.baseUrl + "report/wizard/security/retrieveReportUserList");
    // return this._http.get("https://e911.dev.att.com/enmt/report/wizard/security/retrieveReportUserList");
  }

  getReportSecurityRoles() : Observable<any>
  {
    return this._http.get(environment.baseUrl + "report/wizard/security/getReportSecurityRoles");
    // return this._http.get("https://e911.dev.att.com/enmt/report/wizard/security/getReportSecurityRoles");
  }

  addReportUser(reportUserId : string) : Observable<any>
  {
    return this._http.post(environment.baseUrl + "report/security/addReportUser", reportUserId, { headers: new HttpHeaders({'Content-Type': 'application/json'})});
    // return this._http.post("https://e911.dev.att.com/enmt/report/security/addReportUser", reportUserId, { headers: new HttpHeaders({'Content-Type': 'application/json'})});
  }

  removeReportUser(reportUserId : string) : Observable<any>
  {
    return this._http.post(environment.baseUrl + "report/security/removeReportUser", reportUserId, { headers: new HttpHeaders({'Content-Type': 'application/json'})});
    // return this._http.post("https://e911.dev.att.com/enmt/report/security/removeReportUser", reportUserId, { headers: new HttpHeaders({'Content-Type': 'application/json'})});
  }

  addUserEditAccess(reportUserId : string, readOnly : string)
  {
    return this._http.post(environment.baseUrl + "report/security/toggleUserEditAccess/" + reportUserId, readOnly, { headers: new HttpHeaders({'Content-Type': 'application/json'})});
    // return this._http.post("https://e911.dev.att.com/enmt/report/security/toggleUserEditAccess/" + reportUserId, "N", { headers: new HttpHeaders({'Content-Type': 'application/json'})});
  }

  addReportRole(roleId : string) : Observable<any>
  {
    return this._http.post(environment.baseUrl + "report/security/addReportRole", roleId, { headers: new HttpHeaders({'Content-Type': 'application/json'})});
  }

  removeReportRole(roleId : string) : Observable<any>
  {
    return this._http.post(environment.baseUrl + "report/security/removeReportRole", roleId, { headers: new HttpHeaders({'Content-Type': 'application/json'})})
  }

  addRoleEditAccess(roleId : string, readOnly : string)
  {
    return this._http.post(environment.baseUrl + "report/security/toggleRoleEditAccess/" + roleId, readOnly, { headers: new HttpHeaders({'Content-Type': 'application/json'})});
  }

  saveSecurityTabInfo(finalPostObj : any) : Observable<any>
  {
    return this._http.post(environment.baseUrl + "report/security/updateReportSecurityInfo", finalPostObj, { headers: new HttpHeaders({'Content-Type': 'application/json'})});
  }
}