@huntsman-cancer-institute/user 15.0.2 → 16.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/authorization/role-check-unless-null.directive.d.ts +1 -1
- package/authorization/role-check.directive.d.ts +1 -1
- package/{esm2020 → esm2022}/authorization/role-check-unless-null.directive.mjs +4 -4
- package/{esm2020 → esm2022}/authorization/role-check.directive.mjs +4 -4
- package/{esm2020 → esm2022}/user.module.mjs +11 -11
- package/esm2022/user.service.mjs +98 -0
- package/{fesm2020 → fesm2022}/huntsman-cancer-institute-user.mjs +27 -27
- package/fesm2022/huntsman-cancer-institute-user.mjs.map +1 -0
- package/package.json +7 -13
- package/esm2020/user.service.mjs +0 -98
- package/fesm2015/huntsman-cancer-institute-user.mjs +0 -427
- package/fesm2015/huntsman-cancer-institute-user.mjs.map +0 -1
- package/fesm2020/huntsman-cancer-institute-user.mjs.map +0 -1
- /package/{esm2020 → esm2022}/authorization/permission.entity.mjs +0 -0
- /package/{esm2020 → esm2022}/authorization/role.entity.mjs +0 -0
- /package/{esm2020 → esm2022}/huntsman-cancer-institute-user.mjs +0 -0
- /package/{esm2020 → esm2022}/index.mjs +0 -0
- /package/{esm2020 → esm2022}/user.entity.mjs +0 -0
|
@@ -15,7 +15,7 @@ export declare class RoleCheckUnlessNullDirective extends RoleCheckDirective {
|
|
|
15
15
|
set hciHasRoleUnlessNull(roleName: string);
|
|
16
16
|
private _updateView;
|
|
17
17
|
static ɵfac: i0.ɵɵFactoryDeclaration<RoleCheckUnlessNullDirective, never>;
|
|
18
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<RoleCheckUnlessNullDirective, "[hciHasRoleUnlessNull]", never, { "hciHasRoleUnlessNull": "hciHasRoleUnlessNull"; }, {}, never, never, false, never>;
|
|
18
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<RoleCheckUnlessNullDirective, "[hciHasRoleUnlessNull]", never, { "hciHasRoleUnlessNull": { "alias": "hciHasRoleUnlessNull"; "required": false; }; }, {}, never, never, false, never>;
|
|
19
19
|
}
|
|
20
20
|
/**
|
|
21
21
|
* I totally ripped off *ngIf source to get this to work correctly to prevent infinit loop rendering.
|
|
@@ -22,5 +22,5 @@ export declare class RoleCheckDirective {
|
|
|
22
22
|
*/
|
|
23
23
|
set hciHasRole(roleName: string);
|
|
24
24
|
static ɵfac: i0.ɵɵFactoryDeclaration<RoleCheckDirective, never>;
|
|
25
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<RoleCheckDirective, "[hciHasRole]", never, { "hciHasRole": "hciHasRole"; }, {}, never, never, false, never>;
|
|
25
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<RoleCheckDirective, "[hciHasRole]", never, { "hciHasRole": { "alias": "hciHasRole"; "required": false; }; }, {}, never, never, false, never>;
|
|
26
26
|
}
|
|
@@ -40,10 +40,10 @@ export class RoleCheckUnlessNullDirective extends RoleCheckDirective {
|
|
|
40
40
|
this._viewContainer.createEmbeddedView(this._templateRef, this._context);
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: RoleCheckUnlessNullDirective, deps: [{ token: i0.ViewContainerRef }, { token: i0.TemplateRef }, { token: i1.UserService }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
44
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: RoleCheckUnlessNullDirective, selector: "[hciHasRoleUnlessNull]", inputs: { hciHasRoleUnlessNull: "hciHasRoleUnlessNull" }, usesInheritance: true, ngImport: i0 }); }
|
|
43
45
|
}
|
|
44
|
-
|
|
45
|
-
RoleCheckUnlessNullDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.10", type: RoleCheckUnlessNullDirective, selector: "[hciHasRoleUnlessNull]", inputs: { hciHasRoleUnlessNull: "hciHasRoleUnlessNull" }, usesInheritance: true, ngImport: i0 });
|
|
46
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: RoleCheckUnlessNullDirective, decorators: [{
|
|
46
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: RoleCheckUnlessNullDirective, decorators: [{
|
|
47
47
|
type: Directive,
|
|
48
48
|
args: [{
|
|
49
49
|
selector: "[hciHasRoleUnlessNull]"
|
|
@@ -59,4 +59,4 @@ export class HciHasRoleUnlessNullContext {
|
|
|
59
59
|
this._condition = false;
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
62
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicm9sZS1jaGVjay11bmxlc3MtbnVsbC5kaXJlY3RpdmUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9wcm9qZWN0cy91c2VyL3NyYy9hdXRob3JpemF0aW9uL3JvbGUtY2hlY2stdW5sZXNzLW51bGwuZGlyZWN0aXZlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOztHQUVHO0FBQ0gsT0FBTyxFQUFDLFNBQVMsRUFBRSxLQUFLLEVBQUUsZ0JBQWdCLEVBQUUsV0FBVyxFQUFDLE1BQU0sZUFBZSxDQUFDO0FBQzlFLE9BQU8sRUFBQyxrQkFBa0IsRUFBQyxNQUFNLHdCQUF3QixDQUFDO0FBQzFELE9BQU8sRUFBQyxXQUFXLEVBQUMsTUFBTSxpQkFBaUIsQ0FBQzs7O0FBRTVDOzs7Ozs7R0FNRztBQUlILE1BQU0sT0FBTyw0QkFBNkIsU0FBUSxrQkFBa0I7SUFJbEUsWUFDRSxjQUFnQyxFQUNoQyxZQUFpQyxFQUNqQyxPQUFvQjtRQUNwQixLQUFLLENBQUMsY0FBYyxFQUFF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MuX3RlbXBsYXRlUmVmLCB0aGlzLl9jb250ZXh0KTtcclxuICAgIH0gZWxzZSB7XHJcbiAgICAgIHRoaXMuX3ZpZXdDb250YWluZXIuY3JlYXRlRW1iZWRkZWRWaWV3KHRoaXMuX3RlbXBsYXRlUmVmLCB0aGlzLl9jb250ZXh0KTtcclxuICAgIH1cclxuICB9XHJcbn1cclxuXHJcbi8qKlxyXG4gKiBJIHRvdGFsbHkgcmlwcGVkIG9mZiAqbmdJZiBzb3VyY2UgdG8gZ2V0IHRoaXMgdG8gd29yayBjb3JyZWN0bHkgdG8gcHJldmVudCBpbmZpbml0IGxvb3AgcmVuZGVyaW5nLlxyXG4gKi9cclxuZXhwb3J0IGNsYXNzIEhjaUhhc1JvbGVVbmxlc3NOdWxsQ29udGV4dCB7XHJcbiAgcHVibGljIF9jb25kaXRpb246IGJvb2xlYW4gPSBmYWxzZTtcclxufVxyXG4iXX0=
|
|
@@ -51,10 +51,10 @@ export class RoleCheckDirective {
|
|
|
51
51
|
// Gobble up the error.
|
|
52
52
|
});
|
|
53
53
|
}
|
|
54
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: RoleCheckDirective, deps: [{ token: i0.ViewContainerRef }, { token: i0.TemplateRef }, { token: i1.UserService }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
55
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: RoleCheckDirective, selector: "[hciHasRole]", inputs: { hciHasRole: "hciHasRole" }, providers: [UserService], ngImport: i0 }); }
|
|
54
56
|
}
|
|
55
|
-
|
|
56
|
-
RoleCheckDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.10", type: RoleCheckDirective, selector: "[hciHasRole]", inputs: { hciHasRole: "hciHasRole" }, providers: [UserService], ngImport: i0 });
|
|
57
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: RoleCheckDirective, decorators: [{
|
|
57
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: RoleCheckDirective, decorators: [{
|
|
58
58
|
type: Directive,
|
|
59
59
|
args: [{
|
|
60
60
|
selector: "[hciHasRole]",
|
|
@@ -63,4 +63,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
63
63
|
}], ctorParameters: function () { return [{ type: i0.ViewContainerRef }, { type: i0.TemplateRef }, { type: i1.UserService }]; }, propDecorators: { hciHasRole: [{
|
|
64
64
|
type: Input
|
|
65
65
|
}] } });
|
|
66
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
66
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicm9sZS1jaGVjay5kaXJlY3RpdmUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9wcm9qZWN0cy91c2VyL3NyYy9hdXRob3JpemF0aW9uL3JvbGUtY2hlY2suZGlyZWN0aXZlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOztHQUVHO0FBQ0gsT0FBTyxFQUFDLFNBQVMsRUFBRSxLQUFLLEVBQUUsV0FBVyxFQUFFLGdCQUFnQixFQUFFLFNBQVMsRUFBQyxNQUFNLGVBQWUsQ0FBQztBQUV6RixPQUFPLEVBQUMsV0FBVyxFQUFDLE1BQU0saUJBQWlCLENBQUM7OztBQUc1Qzs7Ozs7OztHQU9HO0FBS0gsTUFBTSxPQUFPLGtCQUFrQjtJQUc3QixZQUFzQixjQUFnQyxFQUNoQyxZQUFpQyxFQUNqQyxPQUFvQjtRQUZwQixtQkFBYyxHQUFkLGNBQWMsQ0FBa0I7UUFDaEMsaUJBQVksR0FBWixZQUFZLENBQXFCO1FBQ2pDLFlBQU8sR0FBUCxPQUFPLENBQWE7UUF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yXG5cclxuIl19
|
|
@@ -22,17 +22,17 @@ export class UserModule {
|
|
|
22
22
|
ngModule: UserModule
|
|
23
23
|
};
|
|
24
24
|
}
|
|
25
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: UserModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
26
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.2.12", ngImport: i0, type: UserModule, declarations: [RoleCheckDirective,
|
|
27
|
+
RoleCheckUnlessNullDirective], imports: [CommonModule,
|
|
28
|
+
ReactiveFormsModule,
|
|
29
|
+
FormsModule], exports: [RoleCheckDirective,
|
|
30
|
+
RoleCheckUnlessNullDirective] }); }
|
|
31
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: UserModule, imports: [CommonModule,
|
|
32
|
+
ReactiveFormsModule,
|
|
33
|
+
FormsModule] }); }
|
|
25
34
|
}
|
|
26
|
-
|
|
27
|
-
UserModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.10", ngImport: i0, type: UserModule, declarations: [RoleCheckDirective,
|
|
28
|
-
RoleCheckUnlessNullDirective], imports: [CommonModule,
|
|
29
|
-
ReactiveFormsModule,
|
|
30
|
-
FormsModule], exports: [RoleCheckDirective,
|
|
31
|
-
RoleCheckUnlessNullDirective] });
|
|
32
|
-
UserModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: UserModule, imports: [CommonModule,
|
|
33
|
-
ReactiveFormsModule,
|
|
34
|
-
FormsModule] });
|
|
35
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: UserModule, decorators: [{
|
|
35
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: UserModule, decorators: [{
|
|
36
36
|
type: NgModule,
|
|
37
37
|
args: [{
|
|
38
38
|
imports: [
|
|
@@ -50,4 +50,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
50
50
|
]
|
|
51
51
|
}]
|
|
52
52
|
}] });
|
|
53
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
53
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidXNlci5tb2R1bGUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9wcm9qZWN0cy91c2VyL3NyYy91c2VyLm1vZHVsZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7R0FFRztBQUNILE9BQU8sRUFBc0IsUUFBUSxFQUFDLE1BQU0sZUFBZSxDQUFDO0FBQzVELE9BQU8sRUFBQyxZQUFZLEVBQUMsTUFBTSxpQkFBaUIsQ0FBQztBQUM3QyxPQUFPLEVBQUMsbUJBQW1CLEVBQUUsV0FBVyxFQUFDLE1BQU0sZ0JBQWdCLENBQUM7QUFFaEUsT0FBTyxFQUFDLFdBQVcsRUFBQyxNQUFNLGdCQUFnQixDQUFDO0FBQzNDLE9BQU8sRUFBQyxrQkFBa0IsRUFBQyxNQUFNLHNDQUFzQyxDQUFDO0FBQ3hFLE9BQU8sRUFBQyw0QkFBNEIsRUFBQyxNQUFNLGtEQUFrRCxDQUFDOztBQUU5Rjs7OztHQUlHO0FBZ0JILE1BQU0sT0FBTyxVQUFVO0lBQ3JCLE1BQU0sQ0FBQyxPQUFPO1FBQ1osT0FBTztZQUNMLFNBQVMsRUFBRTtnQkFDVCxXQUFXO2FBQ1o7WUFDRCxRQUFRLEVBQUUsVUFBVTtTQUNyQixDQUFDO0lBQ0osQ0FBQzsrR0FSVSxVQUFVO2dIQUFWLFVBQVUsaUJBUm5CLGtCQUFrQjtZQUNsQiw0QkFBNEIsYUFON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nJvbSBcIi4vYXV0aG9yaXphdGlvbi9yb2xlLWNoZWNrLXVubGVzcy1udWxsLmRpcmVjdGl2ZVwiO1xyXG5cclxuLyoqXHJcbiAqIEEgZmVhdHVyZSBtb2R1bGUgZm9yIHVzZXIgcmVsYXRlZCBzZXJ2aWNlcywgZGlyZWN0aXZlcywgcGlwZXMsIGV0Yy4uLlxyXG4gKlxyXG4gKiBAc2luY2UgMS4wLjBcclxuICovXHJcbkBOZ01vZHVsZSh7XHJcbiAgaW1wb3J0czogW1xyXG4gICAgQ29tbW9uTW9kdWxlLFxyXG4gICAgUmVhY3RpdmVGb3Jtc01vZHVsZSxcclxuICAgIEZvcm1zTW9kdWxlXHJcbiAgXSxcclxuICBkZWNsYXJhdGlvbnM6IFtcclxuICAgIFJvbGVDaGVja0RpcmVjdGl2ZSxcclxuICAgIFJvbGVDaGVja1VubGVzc051bGxEaXJlY3RpdmVcclxuICBdLFxyXG4gIGV4cG9ydHM6IFtcclxuICAgIFJvbGVDaGVja0RpcmVjdGl2ZSxcclxuICAgIFJvbGVDaGVja1VubGVzc051bGxEaXJlY3RpdmVcclxuICBdXHJcbn0pXHJcbmV4cG9ydCBjbGFzcyBVc2VyTW9kdWxlIHtcclxuICBzdGF0aWMgZm9yUm9vdCgpOiBNb2R1bGVXaXRoUHJvdmlkZXJzPFVzZXJNb2R1bGU+IHtcclxuICAgIHJldHVybiB7XHJcbiAgICAgIHByb3ZpZGVyczogW1xyXG4gICAgICAgIFVzZXJTZXJ2aWNlXHJcbiAgICAgIF0sXHJcbiAgICAgIG5nTW9kdWxlOiBVc2VyTW9kdWxlXHJcbiAgICB9O1xyXG4gIH1cclxufVxyXG4iXX0=
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2016 Huntsman Cancer Institute at the University of Utah, Confidential and Proprietary
|
|
3
|
+
*/
|
|
4
|
+
import { Injectable, InjectionToken, Inject, isDevMode } from "@angular/core";
|
|
5
|
+
import { HttpClient, HttpHeaders } from "@angular/common/http";
|
|
6
|
+
import { of, throwError } from "rxjs";
|
|
7
|
+
import { catchError, map } from "rxjs/operators";
|
|
8
|
+
import { UserEntity } from "./user.entity";
|
|
9
|
+
import { RoleEntity } from "./authorization/role.entity";
|
|
10
|
+
import { PermissionEntity } from "./authorization/permission.entity";
|
|
11
|
+
import * as i0 from "@angular/core";
|
|
12
|
+
import * as i1 from "@angular/common/http";
|
|
13
|
+
export let AUTHENTICATED_USER_ENDPOINT = new InjectionToken("authenticated_user_url");
|
|
14
|
+
/**
|
|
15
|
+
* @since 1.0.0
|
|
16
|
+
*/
|
|
17
|
+
export class UserService {
|
|
18
|
+
/**
|
|
19
|
+
* The generic error message used when a server error is thrown without a status.
|
|
20
|
+
*
|
|
21
|
+
* @type {string}
|
|
22
|
+
*/
|
|
23
|
+
static { this.GENERIC_ERR_MSG = "Server error"; }
|
|
24
|
+
constructor(_http, _authenticationUserEndpoint) {
|
|
25
|
+
this._http = _http;
|
|
26
|
+
this._authenticationUserEndpoint = _authenticationUserEndpoint;
|
|
27
|
+
this._authenticatedUser = null;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* An accessor for an {@code Observable<UserEntity>} reflecting the currently authenticated user. If no subject is
|
|
31
|
+
* available, the appropriate response status should be returned from the server to indicate that condition
|
|
32
|
+
* (i.e. 404 - Not Found).
|
|
33
|
+
*
|
|
34
|
+
* @returns {Observable<UserEntity>} the currently authenticated user representation
|
|
35
|
+
*/
|
|
36
|
+
getAuthenticatedUser() {
|
|
37
|
+
if (isDevMode() && console && console.debug) {
|
|
38
|
+
console.debug("getAuthenticatedUser");
|
|
39
|
+
}
|
|
40
|
+
if (!this._authenticatedUser) {
|
|
41
|
+
if (isDevMode() && console && console.debug) {
|
|
42
|
+
console.debug("_authenticationUserEndpoint: " + this._authenticationUserEndpoint);
|
|
43
|
+
}
|
|
44
|
+
return this._http.get(this._authenticationUserEndpoint, { observe: "response" }).pipe(map((resp) => {
|
|
45
|
+
if (resp.status === 200) {
|
|
46
|
+
this._authenticatedUser = this.buildUserEntity(resp.body);
|
|
47
|
+
return this._authenticatedUser;
|
|
48
|
+
}
|
|
49
|
+
else {
|
|
50
|
+
throw new Error("Get authenticated user failed. " + resp.status + ": " + resp.statusText);
|
|
51
|
+
}
|
|
52
|
+
}), catchError(this.handleError));
|
|
53
|
+
}
|
|
54
|
+
else {
|
|
55
|
+
return of(this._authenticatedUser);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
handleError(error) {
|
|
59
|
+
let errMsg = (error.message) ? error.message : UserService.GENERIC_ERR_MSG;
|
|
60
|
+
return throwError(() => new Error(errMsg));
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* TODO: Add in a deserializer into the entity.
|
|
64
|
+
*
|
|
65
|
+
* @param userJson
|
|
66
|
+
* @returns {UserEntity}
|
|
67
|
+
*/
|
|
68
|
+
buildUserEntity(userJson) {
|
|
69
|
+
let roles = [];
|
|
70
|
+
if (userJson.roles) {
|
|
71
|
+
userJson.roles.map((role) => {
|
|
72
|
+
let permissions;
|
|
73
|
+
if (role.permissions) {
|
|
74
|
+
/* TODO: JEH (10/27/16) - Revisit when we determine how permission are communicated to the client, if necessary */
|
|
75
|
+
permissions = role.permissions.map((permission) => {
|
|
76
|
+
return new PermissionEntity(permission.domain, permission.actions, permission.instances);
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
roles.push(new RoleEntity(role.roleName, permissions));
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
return new UserEntity(userJson.idUser, userJson.username, roles, userJson.firstname, userJson.lastname, userJson.href);
|
|
83
|
+
}
|
|
84
|
+
getPermissions(governorClass, governorId, governedClass) {
|
|
85
|
+
let headers = new HttpHeaders()
|
|
86
|
+
.set("SecurityGovernorClass", governorClass).set("SecurityGovernorId", String(governorId));
|
|
87
|
+
return this._http.get("/core/api/user/permissions/" + governedClass, { headers: headers });
|
|
88
|
+
}
|
|
89
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: UserService, deps: [{ token: i1.HttpClient }, { token: AUTHENTICATED_USER_ENDPOINT }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
90
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: UserService }); }
|
|
91
|
+
}
|
|
92
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: UserService, decorators: [{
|
|
93
|
+
type: Injectable
|
|
94
|
+
}], ctorParameters: function () { return [{ type: i1.HttpClient }, { type: undefined, decorators: [{
|
|
95
|
+
type: Inject,
|
|
96
|
+
args: [AUTHENTICATED_USER_ENDPOINT]
|
|
97
|
+
}] }]; } });
|
|
98
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidXNlci5zZXJ2aWNlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vcHJvamVjdHMvdXNlci9zcmMvdXNlci5zZXJ2aWNlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOztHQUVHO0FBQ0gsT0FBTyxFQUFDLFVBQVUsRUFBRSxjQUFjLEVBQUUsTUFBTSxFQUFFLFNBQVMsRUFBQyxNQUFNLGVBQWUsQ0FBQztBQUM1RSxPQUFPLEVBQUMsVUFBVSxFQUFnQixXQUFXLEVBQUMsTUFBTSxzQkFBc0IsQ0FBQztBQUUzRSxPQUFPLEVBQWEsRUFBRSxFQUFFLFVBQVUsRUFBQyxNQUFNLE1BQU0sQ0FBQztBQUNoRCxPQUFPLEVBQUMsVUFBVSxFQUFFLEdBQUcsRUFBQyxNQUFNLGdCQUFnQixDQUFDO0FBRS9DLE9BQU8sRUFBQyxVQUFVLEVBQUMsTUFBTSxlQUFlLENBQUM7QUFDekMsT0FBTyxFQUFD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iJdfQ==
|
|
@@ -4,7 +4,7 @@ import { CommonModule } from '@angular/common';
|
|
|
4
4
|
import { ReactiveFormsModule, FormsModule } from '@angular/forms';
|
|
5
5
|
import * as i1 from '@angular/common/http';
|
|
6
6
|
import { HttpHeaders } from '@angular/common/http';
|
|
7
|
-
import { of,
|
|
7
|
+
import { of, throwError } from 'rxjs';
|
|
8
8
|
import { map, catchError } from 'rxjs/operators';
|
|
9
9
|
|
|
10
10
|
/**
|
|
@@ -162,6 +162,12 @@ let AUTHENTICATED_USER_ENDPOINT = new InjectionToken("authenticated_user_url");
|
|
|
162
162
|
* @since 1.0.0
|
|
163
163
|
*/
|
|
164
164
|
class UserService {
|
|
165
|
+
/**
|
|
166
|
+
* The generic error message used when a server error is thrown without a status.
|
|
167
|
+
*
|
|
168
|
+
* @type {string}
|
|
169
|
+
*/
|
|
170
|
+
static { this.GENERIC_ERR_MSG = "Server error"; }
|
|
165
171
|
constructor(_http, _authenticationUserEndpoint) {
|
|
166
172
|
this._http = _http;
|
|
167
173
|
this._authenticationUserEndpoint = _authenticationUserEndpoint;
|
|
@@ -198,7 +204,7 @@ class UserService {
|
|
|
198
204
|
}
|
|
199
205
|
handleError(error) {
|
|
200
206
|
let errMsg = (error.message) ? error.message : UserService.GENERIC_ERR_MSG;
|
|
201
|
-
return
|
|
207
|
+
return throwError(() => new Error(errMsg));
|
|
202
208
|
}
|
|
203
209
|
/**
|
|
204
210
|
* TODO: Add in a deserializer into the entity.
|
|
@@ -227,16 +233,10 @@ class UserService {
|
|
|
227
233
|
.set("SecurityGovernorClass", governorClass).set("SecurityGovernorId", String(governorId));
|
|
228
234
|
return this._http.get("/core/api/user/permissions/" + governedClass, { headers: headers });
|
|
229
235
|
}
|
|
236
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: UserService, deps: [{ token: i1.HttpClient }, { token: AUTHENTICATED_USER_ENDPOINT }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
237
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: UserService }); }
|
|
230
238
|
}
|
|
231
|
-
|
|
232
|
-
* The generic error message used when a server error is thrown without a status.
|
|
233
|
-
*
|
|
234
|
-
* @type {string}
|
|
235
|
-
*/
|
|
236
|
-
UserService.GENERIC_ERR_MSG = "Server error";
|
|
237
|
-
UserService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: UserService, deps: [{ token: i1.HttpClient }, { token: AUTHENTICATED_USER_ENDPOINT }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
238
|
-
UserService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: UserService });
|
|
239
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: UserService, decorators: [{
|
|
239
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: UserService, decorators: [{
|
|
240
240
|
type: Injectable
|
|
241
241
|
}], ctorParameters: function () { return [{ type: i1.HttpClient }, { type: undefined, decorators: [{
|
|
242
242
|
type: Inject,
|
|
@@ -292,10 +292,10 @@ class RoleCheckDirective {
|
|
|
292
292
|
// Gobble up the error.
|
|
293
293
|
});
|
|
294
294
|
}
|
|
295
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: RoleCheckDirective, deps: [{ token: i0.ViewContainerRef }, { token: i0.TemplateRef }, { token: UserService }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
296
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: RoleCheckDirective, selector: "[hciHasRole]", inputs: { hciHasRole: "hciHasRole" }, providers: [UserService], ngImport: i0 }); }
|
|
295
297
|
}
|
|
296
|
-
|
|
297
|
-
RoleCheckDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.10", type: RoleCheckDirective, selector: "[hciHasRole]", inputs: { hciHasRole: "hciHasRole" }, providers: [UserService], ngImport: i0 });
|
|
298
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: RoleCheckDirective, decorators: [{
|
|
298
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: RoleCheckDirective, decorators: [{
|
|
299
299
|
type: Directive,
|
|
300
300
|
args: [{
|
|
301
301
|
selector: "[hciHasRole]",
|
|
@@ -342,10 +342,10 @@ class RoleCheckUnlessNullDirective extends RoleCheckDirective {
|
|
|
342
342
|
this._viewContainer.createEmbeddedView(this._templateRef, this._context);
|
|
343
343
|
}
|
|
344
344
|
}
|
|
345
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: RoleCheckUnlessNullDirective, deps: [{ token: i0.ViewContainerRef }, { token: i0.TemplateRef }, { token: UserService }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
346
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: RoleCheckUnlessNullDirective, selector: "[hciHasRoleUnlessNull]", inputs: { hciHasRoleUnlessNull: "hciHasRoleUnlessNull" }, usesInheritance: true, ngImport: i0 }); }
|
|
345
347
|
}
|
|
346
|
-
|
|
347
|
-
RoleCheckUnlessNullDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.10", type: RoleCheckUnlessNullDirective, selector: "[hciHasRoleUnlessNull]", inputs: { hciHasRoleUnlessNull: "hciHasRoleUnlessNull" }, usesInheritance: true, ngImport: i0 });
|
|
348
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: RoleCheckUnlessNullDirective, decorators: [{
|
|
348
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: RoleCheckUnlessNullDirective, decorators: [{
|
|
349
349
|
type: Directive,
|
|
350
350
|
args: [{
|
|
351
351
|
selector: "[hciHasRoleUnlessNull]"
|
|
@@ -379,17 +379,17 @@ class UserModule {
|
|
|
379
379
|
ngModule: UserModule
|
|
380
380
|
};
|
|
381
381
|
}
|
|
382
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: UserModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
383
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.2.12", ngImport: i0, type: UserModule, declarations: [RoleCheckDirective,
|
|
384
|
+
RoleCheckUnlessNullDirective], imports: [CommonModule,
|
|
385
|
+
ReactiveFormsModule,
|
|
386
|
+
FormsModule], exports: [RoleCheckDirective,
|
|
387
|
+
RoleCheckUnlessNullDirective] }); }
|
|
388
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: UserModule, imports: [CommonModule,
|
|
389
|
+
ReactiveFormsModule,
|
|
390
|
+
FormsModule] }); }
|
|
382
391
|
}
|
|
383
|
-
|
|
384
|
-
UserModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.10", ngImport: i0, type: UserModule, declarations: [RoleCheckDirective,
|
|
385
|
-
RoleCheckUnlessNullDirective], imports: [CommonModule,
|
|
386
|
-
ReactiveFormsModule,
|
|
387
|
-
FormsModule], exports: [RoleCheckDirective,
|
|
388
|
-
RoleCheckUnlessNullDirective] });
|
|
389
|
-
UserModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: UserModule, imports: [CommonModule,
|
|
390
|
-
ReactiveFormsModule,
|
|
391
|
-
FormsModule] });
|
|
392
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: UserModule, decorators: [{
|
|
392
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: UserModule, decorators: [{
|
|
393
393
|
type: NgModule,
|
|
394
394
|
args: [{
|
|
395
395
|
imports: [
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"huntsman-cancer-institute-user.mjs","sources":["../../../projects/user/src/user.entity.ts","../../../projects/user/src/authorization/role.entity.ts","../../../projects/user/src/authorization/permission.entity.ts","../../../projects/user/src/user.service.ts","../../../projects/user/src/authorization/role-check.directive.ts","../../../projects/user/src/authorization/role-check-unless-null.directive.ts","../../../projects/user/src/user.module.ts","../../../projects/user/src/index.ts","../../../projects/user/src/huntsman-cancer-institute-user.ts"],"sourcesContent":["/*\r\n * Copyright (c) 2016 Huntsman Cancer Institute at the University of Utah, Confidential and Proprietary\r\n */\r\nimport {RoleEntity} from \"./authorization/role.entity\";\r\n\r\n/**\r\n * An immutable representation of an HCI user entity.\r\n *\r\n * @since 1.0.0\r\n */\r\nexport class UserEntity {\r\n constructor(private id: string,\r\n private username: string,\r\n private roles?: RoleEntity[],\r\n private firstname?: string,\r\n private lastname?: string,\r\n private href?: string) {\r\n }\r\n\r\n /**\r\n * An accessor for the users system id.\r\n *\r\n * @returns {string} the system id\r\n * @constructor\r\n */\r\n get Id(): string {\r\n return this.id;\r\n }\r\n\r\n /**\r\n * An accessor for the users application identifier/username.\r\n *\r\n * @returns {string} the application id/username\r\n * @constructor\r\n */\r\n get Username(): string {\r\n return this.username;\r\n }\r\n\r\n /**\r\n * An accessor for the users assigned role authorization claims.\r\n *\r\n * @returns {@code RoleEntity[]} the role authorization claims\r\n * @constructor\r\n */\r\n get Roles(): RoleEntity[] {\r\n return this.roles;\r\n }\r\n\r\n /**\r\n * An accessor for the users firstname.\r\n *\r\n * @return {string} the firstname\r\n * @constructor\r\n */\r\n get Firstname(): string {\r\n return this.firstname;\r\n }\r\n\r\n /**\r\n * A accessor for the users lastname.\r\n *\r\n * @return {string} the lastname\r\n * @constructor\r\n */\r\n get Lastname(): string {\r\n return this.lastname;\r\n }\r\n\r\n /**\r\n * A access for the users fully qualified href location on the system.\r\n *\r\n * @return {string} the href location\r\n * @constructor\r\n */\r\n get Href(): string {\r\n return this.href;\r\n }\r\n\r\n}\r\n","/*\r\n * Copyright (c) 2016 Huntsman Cancer Institute at the University of Utah, Confidential and Proprietary\r\n */\r\nimport {PermissionEntity} from \"./permission.entity\";\r\n\r\n/**\r\n * An immutable representation of an HCI role entity, which represents an authorization claim associated with an authenticated\r\n * subject.\r\n *\r\n * @since 1.0.0\r\n */\r\nexport class RoleEntity {\r\n constructor( private roleName: string, private permissions?: PermissionEntity[]) {}\r\n\r\n /**\r\n * An accessor for the name of this role.\r\n *\r\n * @returns {string} the role name\r\n * @constructor\r\n */\r\n get RoleName(): string {\r\n return this.roleName;\r\n }\r\n\r\n /**\r\n * An accessor for a collection of {@link PermissionEntity} authorization claims that define this role. Permissions\r\n * provide a finer grained authorization claim description and are not required.\r\n *\r\n * @returns {PermissionEntity[]} a collection of permission entities\r\n * @constructor\r\n */\r\n get Permissions(): PermissionEntity[] {\r\n return this.permissions;\r\n }\r\n}\r\n","/*\r\n * Copyright (c) 2016 Huntsman Cancer Institute at the University of Utah, Confidential and Proprietary\r\n */\r\n/**\r\n * An immutable representation of an HCI permission entity, which represents a fine grained authorization claim that can\r\n * define a {@link RoleEntity}.\r\n *\r\n * @since 1.0.0\r\n */\r\nexport class PermissionEntity {\r\n constructor(private domain: string, private actions?: string[], private instances?: string[]) {\r\n }\r\n\r\n /**\r\n * An accessor for the domain this permission is defined for (i.e. user, study, specimen, etc...).\r\n *\r\n * @returns {string} the domain of this permission\r\n * @constructor\r\n */\r\n get Domain(): string {\r\n return this.domain;\r\n }\r\n\r\n /**\r\n * An accessor for the actions that this permission allows in the specified domain (i.e. create, read, activate, manage\r\n * etc...). If no actions are defined, this permission claims access to all actions of the specified domain.\r\n *\r\n * @returns {string[]} an array of actions for the specified domain\r\n * @constructor\r\n */\r\n get Actions(): string[] {\r\n return this.actions;\r\n }\r\n\r\n /**\r\n * An accessor for the instances that this permission is applicable to in the specified domain (i.e. joe, 1234, study-foo,\r\n * etc...). If no instances are defined, this permission claims applicability to all instances of the specified domain.\r\n * @returns {string[]}\r\n * @constructor\r\n */\r\n get Instances(): string[] {\r\n return this.instances;\r\n }\r\n}\r\n","/*\r\n * Copyright (c) 2016 Huntsman Cancer Institute at the University of Utah, Confidential and Proprietary\r\n */\r\nimport {Injectable, InjectionToken, Inject, isDevMode} from \"@angular/core\";\r\nimport {HttpClient, HttpResponse, HttpHeaders} from \"@angular/common/http\";\r\n\r\nimport {Observable, of, throwError} from \"rxjs\";\r\nimport {catchError, map} from \"rxjs/operators\";\r\n\r\nimport {UserEntity} from \"./user.entity\";\r\nimport {RoleEntity} from \"./authorization/role.entity\";\r\nimport {PermissionEntity} from \"./authorization/permission.entity\";\r\n\r\nexport let AUTHENTICATED_USER_ENDPOINT = new InjectionToken<string>(\"authenticated_user_url\");\r\n\r\n/**\r\n * @since 1.0.0\r\n */\r\n@Injectable()\r\nexport class UserService {\r\n /**\r\n * The generic error message used when a server error is thrown without a status.\r\n *\r\n * @type {string}\r\n */\r\n public static GENERIC_ERR_MSG: string = \"Server error\";\r\n\r\n private _authenticatedUser: UserEntity = null;\r\n\r\n constructor(private _http: HttpClient, @Inject(AUTHENTICATED_USER_ENDPOINT) private _authenticationUserEndpoint: string) {}\r\n\r\n /**\r\n * An accessor for an {@code Observable<UserEntity>} reflecting the currently authenticated user. If no subject is\r\n * available, the appropriate response status should be returned from the server to indicate that condition\r\n * (i.e. 404 - Not Found).\r\n *\r\n * @returns {Observable<UserEntity>} the currently authenticated user representation\r\n */\r\n public getAuthenticatedUser(): Observable<UserEntity> {\r\n if (isDevMode() && <any>console && <any>console.debug) {\r\n console.debug(\"getAuthenticatedUser\");\r\n }\r\n\r\n if (!this._authenticatedUser) {\r\n if (isDevMode() && <any>console && <any>console.debug) {\r\n console.debug(\"_authenticationUserEndpoint: \" + this._authenticationUserEndpoint);\r\n }\r\n\r\n return this._http.get(this._authenticationUserEndpoint, { observe: \"response\" }).pipe(map((resp: HttpResponse<any>) => {\r\n if (resp.status === 200) {\r\n this._authenticatedUser = this.buildUserEntity(resp.body);\r\n return this._authenticatedUser;\r\n } else {\r\n throw new Error(\"Get authenticated user failed. \" + resp.status + \": \" + resp.statusText);\r\n }\r\n }),\r\n catchError(this.handleError));\r\n } else {\r\n return of(this._authenticatedUser);\r\n }\r\n }\r\n\r\n private handleError(error: any) {\r\n let errMsg = (error.message) ? error.message : UserService.GENERIC_ERR_MSG;\r\n \r\n return throwError(() => new Error(errMsg));\r\n }\r\n\r\n /**\r\n * TODO: Add in a deserializer into the entity.\r\n *\r\n * @param userJson\r\n * @returns {UserEntity}\r\n */\r\n private buildUserEntity(userJson: any): UserEntity {\r\n let roles: RoleEntity[] = [];\r\n if (userJson.roles) {\r\n userJson.roles.map((role: any) => {\r\n let permissions: PermissionEntity[];\r\n if (role.permissions) {\r\n /* TODO: JEH (10/27/16) - Revisit when we determine how permission are communicated to the client, if necessary */\r\n permissions = role.permissions.map((permission: any) => {\r\n return new PermissionEntity(permission.domain, permission.actions, permission.instances);\r\n });\r\n }\r\n roles.push(new RoleEntity(role.roleName, permissions));\r\n });\r\n }\r\n\r\n return new UserEntity(userJson.idUser, userJson.username, roles, userJson.firstname, userJson.lastname, userJson.href);\r\n }\r\n \r\n public getPermissions(governorClass: string, governorId: number, governedClass: string): Observable<any> {\r\n let headers = new HttpHeaders()\r\n .set(\"SecurityGovernorClass\", governorClass).set(\"SecurityGovernorId\", String(governorId));\r\n return this._http.get(\"/core/api/user/permissions/\" + governedClass, {headers: headers});\r\n }\r\n}\r\n","/*\r\n * Copyright (c) 2016 Huntsman Cancer Institute at the University of Utah, Confidential and Proprietary\r\n */\r\nimport {Directive, Input, TemplateRef, ViewContainerRef, isDevMode} from \"@angular/core\";\r\n\r\nimport {UserService} from \"../user.service\";\r\nimport {UserEntity} from \"../user.entity\";\r\n\r\n/**\r\n * A structural directive for adding and removing elements of the client application based on a users <em>role</em>\r\n * authorization claims.\r\n *\r\n * This directive requires the {@link UserService} as a provider.\r\n *\r\n * @since 1.0.0\r\n */\r\n@Directive({\r\n selector: \"[hciHasRole]\",\r\n providers: [UserService]\r\n})\r\nexport class RoleCheckDirective {\r\n protected _lastCheck: boolean = null;\r\n\r\n constructor(protected _viewContainer: ViewContainerRef,\r\n protected _templateRef: TemplateRef<Object>,\r\n protected _usrSvc: UserService) {\r\n }\r\n\r\n /**\r\n * Calculates the availability of a decorated element based on the authenticated users available roles.\r\n *\r\n * @param roleName for the role required to make the decorated element available\r\n */\r\n @Input()\r\n set hciHasRole(roleName: string) {\r\n if (isDevMode() && <any>console && <any>console.debug) {\r\n console.debug(\"hciHasRole\");\r\n }\r\n\r\n this._usrSvc.getAuthenticatedUser().subscribe((authUser: UserEntity) => {\r\n let found: boolean;\r\n\r\n if (authUser && authUser.Roles) {\r\n found = authUser.Roles.some((role) => {\r\n return role.RoleName === roleName;\r\n });\r\n } else {\r\n found = false;\r\n }\r\n\r\n if (found && (this._lastCheck === null || !this._lastCheck)) {\r\n this._viewContainer.createEmbeddedView(this._templateRef);\r\n } else if (!found && (this._lastCheck === null || this._lastCheck)) {\r\n this._viewContainer.clear();\r\n }\r\n }, (error) => {\r\n // TODO: BHY (08/19/16) - Determine requirements around errors and then REMOVE CONSOLE LOGGING. Display to user,\r\n // log to external source, gobble?\r\n // Gobble up the error.\r\n });\r\n }\r\n}\r\n\r\n","/*\r\n * Copyright (c) 2016 Huntsman Cancer Institute at the University of Utah, Confidential and Proprietary\r\n */\r\nimport {Directive, Input, ViewContainerRef, TemplateRef} from \"@angular/core\";\r\nimport {RoleCheckDirective} from \"./role-check.directive\";\r\nimport {UserService} from \"../user.service\";\r\n\r\n/**\r\n * An extension of the {@link RoleCheckDirective} the only evaluates the role if is it not null or undefined.\r\n *\r\n * This directive requires the {@link UserService} as a provider.\r\n *\r\n * @since 1.0.0\r\n */\r\n@Directive({\r\n selector: \"[hciHasRoleUnlessNull]\"\r\n})\r\nexport class RoleCheckUnlessNullDirective extends RoleCheckDirective {\r\n\r\n private _context: HciHasRoleUnlessNullContext = new HciHasRoleUnlessNullContext();\r\n\r\n constructor(\r\n _viewContainer: ViewContainerRef,\r\n _templateRef: TemplateRef<Object>,\r\n _usrSvc: UserService) {\r\n super(_viewContainer, _templateRef, _usrSvc);\r\n }\r\n\r\n @Input()\r\n set hciHasRoleUnlessNull(roleName: string) {\r\n if (!roleName) {\r\n // if the roleName is undefined or null then render\r\n if (this._context._condition !== true) {\r\n this._context._condition = true;\r\n this._updateView();\r\n }\r\n } else {\r\n // otherwise delegate the check to RoleCheckDirective\r\n this.hciHasRole = roleName;\r\n }\r\n }\r\n\r\n private _updateView() {\r\n this._viewContainer.clear();\r\n if (this._context._condition) {\r\n this._viewContainer.createEmbeddedView(this._templateRef, this._context);\r\n } else {\r\n this._viewContainer.createEmbeddedView(this._templateRef, this._context);\r\n }\r\n }\r\n}\r\n\r\n/**\r\n * I totally ripped off *ngIf source to get this to work correctly to prevent infinit loop rendering.\r\n */\r\nexport class HciHasRoleUnlessNullContext {\r\n public _condition: boolean = false;\r\n}\r\n","/*\r\n * Copyright (c) 2016 Huntsman Cancer Institute at the University of Utah, Confidential and Proprietary\r\n */\r\nimport {ModuleWithProviders, NgModule} from \"@angular/core\";\r\nimport {CommonModule} from \"@angular/common\";\r\nimport {ReactiveFormsModule, FormsModule} from \"@angular/forms\";\r\n\r\nimport {UserService} from \"./user.service\";\r\nimport {RoleCheckDirective} from \"./authorization/role-check.directive\";\r\nimport {RoleCheckUnlessNullDirective} from \"./authorization/role-check-unless-null.directive\";\r\n\r\n/**\r\n * A feature module for user related services, directives, pipes, etc...\r\n *\r\n * @since 1.0.0\r\n */\r\n@NgModule({\r\n imports: [\r\n CommonModule,\r\n ReactiveFormsModule,\r\n FormsModule\r\n ],\r\n declarations: [\r\n RoleCheckDirective,\r\n RoleCheckUnlessNullDirective\r\n ],\r\n exports: [\r\n RoleCheckDirective,\r\n RoleCheckUnlessNullDirective\r\n ]\r\n})\r\nexport class UserModule {\r\n static forRoot(): ModuleWithProviders<UserModule> {\r\n return {\r\n providers: [\r\n UserService\r\n ],\r\n ngModule: UserModule\r\n };\r\n }\r\n}\r\n","/*\r\n * Copyright (c) 2016 Huntsman Cancer Institute at the University of Utah, Confidential and Proprietary\r\n */\r\n\r\n/**\r\n * A barrel file for the HCI ng2 user package.\r\n *\r\n * @since 1.0.0\r\n */\r\nexport {UserModule} from \"./user.module\"\r\nexport {UserEntity} from \"./user.entity\"\r\nexport {RoleEntity} from \"./authorization/role.entity\"\r\nexport {PermissionEntity} from \"./authorization/permission.entity\"\r\n\r\n/**\r\n * The opaque tokens for service configuration.\r\n */\r\nexport {\r\n AUTHENTICATED_USER_ENDPOINT\r\n} from \"./user.service\"\r\n\r\nexport {UserService} from \"./user.service\"\r\n\r\nexport {RoleCheckDirective} from \"./authorization/role-check.directive\";\r\nexport {RoleCheckUnlessNullDirective} from \"./authorization/role-check-unless-null.directive\";\r\n\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1.UserService"],"mappings":";;;;;;;;;AAKA;;;;AAIG;MACU,UAAU,CAAA;IACrB,WAAoB,CAAA,EAAU,EACV,QAAgB,EAChB,KAAoB,EACpB,SAAkB,EAClB,QAAiB,EACjB,IAAa,EAAA;QALb,IAAE,CAAA,EAAA,GAAF,EAAE,CAAQ;QACV,IAAQ,CAAA,QAAA,GAAR,QAAQ,CAAQ;QAChB,IAAK,CAAA,KAAA,GAAL,KAAK,CAAe;QACpB,IAAS,CAAA,SAAA,GAAT,SAAS,CAAS;QAClB,IAAQ,CAAA,QAAA,GAAR,QAAQ,CAAS;QACjB,IAAI,CAAA,I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,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,UAAU,iBARnB,kBAAkB;AAClB,YAAA,4BAA4B,aAN5B,YAAY;YACZ,mBAAmB;AACnB,YAAA,WAAW,aAOX,kBAAkB;YAClB,4BAA4B,CAAA,EAAA,CAAA,CAAA,EAAA;AAGnB,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,UAAU,YAbnB,YAAY;YACZ,mBAAmB;YACnB,WAAW,CAAA,EAAA,CAAA,CAAA,EAAA;;4FAWF,UAAU,EAAA,UAAA,EAAA,CAAA;kBAftB,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE;wBACP,YAAY;wBACZ,mBAAmB;wBACnB,WAAW;AACZ,qBAAA;AACD,oBAAA,YAAY,EAAE;wBACZ,kBAAkB;wBAClB,4BAA4B;AAC7B,qBAAA;AACD,oBAAA,OAAO,EAAE;wBACP,kBAAkB;wBAClB,4BAA4B;AAC7B,qBAAA;AACF,iBAAA,CAAA;;;AC9BD;;AAEG;AAEH;;;;AAIG;;ACRH;;AAEG;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@huntsman-cancer-institute/user",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "16.0.0",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git@gitlab.com:huntsman-cancer-institute/risr/ng/hci-ng-lib.git"
|
|
@@ -10,14 +10,10 @@
|
|
|
10
10
|
"access": "public"
|
|
11
11
|
},
|
|
12
12
|
"peerDependencies": {
|
|
13
|
-
"@angular/common": "^
|
|
14
|
-
"@angular/core": "^
|
|
13
|
+
"@angular/common": "^16.x",
|
|
14
|
+
"@angular/core": "^16.x"
|
|
15
15
|
},
|
|
16
|
-
"module": "
|
|
17
|
-
"es2020": "fesm2020/huntsman-cancer-institute-user.mjs",
|
|
18
|
-
"esm2020": "esm2020/huntsman-cancer-institute-user.mjs",
|
|
19
|
-
"fesm2020": "fesm2020/huntsman-cancer-institute-user.mjs",
|
|
20
|
-
"fesm2015": "fesm2015/huntsman-cancer-institute-user.mjs",
|
|
16
|
+
"module": "fesm2022/huntsman-cancer-institute-user.mjs",
|
|
21
17
|
"typings": "index.d.ts",
|
|
22
18
|
"exports": {
|
|
23
19
|
"./package.json": {
|
|
@@ -25,11 +21,9 @@
|
|
|
25
21
|
},
|
|
26
22
|
".": {
|
|
27
23
|
"types": "./index.d.ts",
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
"node": "./fesm2015/huntsman-cancer-institute-user.mjs",
|
|
32
|
-
"default": "./fesm2020/huntsman-cancer-institute-user.mjs"
|
|
24
|
+
"esm2022": "./esm2022/huntsman-cancer-institute-user.mjs",
|
|
25
|
+
"esm": "./esm2022/huntsman-cancer-institute-user.mjs",
|
|
26
|
+
"default": "./fesm2022/huntsman-cancer-institute-user.mjs"
|
|
33
27
|
}
|
|
34
28
|
},
|
|
35
29
|
"sideEffects": false,
|
package/esm2020/user.service.mjs
DELETED
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (c) 2016 Huntsman Cancer Institute at the University of Utah, Confidential and Proprietary
|
|
3
|
-
*/
|
|
4
|
-
import { Injectable, InjectionToken, Inject, isDevMode } from "@angular/core";
|
|
5
|
-
import { HttpClient, HttpHeaders } from "@angular/common/http";
|
|
6
|
-
import { Observable, of } from "rxjs";
|
|
7
|
-
import { catchError, map } from "rxjs/operators";
|
|
8
|
-
import { UserEntity } from "./user.entity";
|
|
9
|
-
import { RoleEntity } from "./authorization/role.entity";
|
|
10
|
-
import { PermissionEntity } from "./authorization/permission.entity";
|
|
11
|
-
import * as i0 from "@angular/core";
|
|
12
|
-
import * as i1 from "@angular/common/http";
|
|
13
|
-
export let AUTHENTICATED_USER_ENDPOINT = new InjectionToken("authenticated_user_url");
|
|
14
|
-
/**
|
|
15
|
-
* @since 1.0.0
|
|
16
|
-
*/
|
|
17
|
-
export class UserService {
|
|
18
|
-
constructor(_http, _authenticationUserEndpoint) {
|
|
19
|
-
this._http = _http;
|
|
20
|
-
this._authenticationUserEndpoint = _authenticationUserEndpoint;
|
|
21
|
-
this._authenticatedUser = null;
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* An accessor for an {@code Observable<UserEntity>} reflecting the currently authenticated user. If no subject is
|
|
25
|
-
* available, the appropriate response status should be returned from the server to indicate that condition
|
|
26
|
-
* (i.e. 404 - Not Found).
|
|
27
|
-
*
|
|
28
|
-
* @returns {Observable<UserEntity>} the currently authenticated user representation
|
|
29
|
-
*/
|
|
30
|
-
getAuthenticatedUser() {
|
|
31
|
-
if (isDevMode() && console && console.debug) {
|
|
32
|
-
console.debug("getAuthenticatedUser");
|
|
33
|
-
}
|
|
34
|
-
if (!this._authenticatedUser) {
|
|
35
|
-
if (isDevMode() && console && console.debug) {
|
|
36
|
-
console.debug("_authenticationUserEndpoint: " + this._authenticationUserEndpoint);
|
|
37
|
-
}
|
|
38
|
-
return this._http.get(this._authenticationUserEndpoint, { observe: "response" }).pipe(map((resp) => {
|
|
39
|
-
if (resp.status === 200) {
|
|
40
|
-
this._authenticatedUser = this.buildUserEntity(resp.body);
|
|
41
|
-
return this._authenticatedUser;
|
|
42
|
-
}
|
|
43
|
-
else {
|
|
44
|
-
throw new Error("Get authenticated user failed. " + resp.status + ": " + resp.statusText);
|
|
45
|
-
}
|
|
46
|
-
}), catchError(this.handleError));
|
|
47
|
-
}
|
|
48
|
-
else {
|
|
49
|
-
return of(this._authenticatedUser);
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
handleError(error) {
|
|
53
|
-
let errMsg = (error.message) ? error.message : UserService.GENERIC_ERR_MSG;
|
|
54
|
-
return Observable.throw(errMsg);
|
|
55
|
-
}
|
|
56
|
-
/**
|
|
57
|
-
* TODO: Add in a deserializer into the entity.
|
|
58
|
-
*
|
|
59
|
-
* @param userJson
|
|
60
|
-
* @returns {UserEntity}
|
|
61
|
-
*/
|
|
62
|
-
buildUserEntity(userJson) {
|
|
63
|
-
let roles = [];
|
|
64
|
-
if (userJson.roles) {
|
|
65
|
-
userJson.roles.map((role) => {
|
|
66
|
-
let permissions;
|
|
67
|
-
if (role.permissions) {
|
|
68
|
-
/* TODO: JEH (10/27/16) - Revisit when we determine how permission are communicated to the client, if necessary */
|
|
69
|
-
permissions = role.permissions.map((permission) => {
|
|
70
|
-
return new PermissionEntity(permission.domain, permission.actions, permission.instances);
|
|
71
|
-
});
|
|
72
|
-
}
|
|
73
|
-
roles.push(new RoleEntity(role.roleName, permissions));
|
|
74
|
-
});
|
|
75
|
-
}
|
|
76
|
-
return new UserEntity(userJson.idUser, userJson.username, roles, userJson.firstname, userJson.lastname, userJson.href);
|
|
77
|
-
}
|
|
78
|
-
getPermissions(governorClass, governorId, governedClass) {
|
|
79
|
-
let headers = new HttpHeaders()
|
|
80
|
-
.set("SecurityGovernorClass", governorClass).set("SecurityGovernorId", String(governorId));
|
|
81
|
-
return this._http.get("/core/api/user/permissions/" + governedClass, { headers: headers });
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
/**
|
|
85
|
-
* The generic error message used when a server error is thrown without a status.
|
|
86
|
-
*
|
|
87
|
-
* @type {string}
|
|
88
|
-
*/
|
|
89
|
-
UserService.GENERIC_ERR_MSG = "Server error";
|
|
90
|
-
UserService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: UserService, deps: [{ token: i1.HttpClient }, { token: AUTHENTICATED_USER_ENDPOINT }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
91
|
-
UserService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: UserService });
|
|
92
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: UserService, decorators: [{
|
|
93
|
-
type: Injectable
|
|
94
|
-
}], ctorParameters: function () { return [{ type: i1.HttpClient }, { type: undefined, decorators: [{
|
|
95
|
-
type: Inject,
|
|
96
|
-
args: [AUTHENTICATED_USER_ENDPOINT]
|
|
97
|
-
}] }]; } });
|
|
98
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidXNlci5zZXJ2aWNlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vcHJvamVjdHMvdXNlci9zcmMvdXNlci5zZXJ2aWNlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOztHQUVHO0FBQ0gsT0FBTyxFQUFDLFVBQVUsRUFBRSxjQUFjLEVBQUUsTUFBTSxFQUFFLFNBQVMsRUFBQyxNQUFNLGVBQWUsQ0FBQztBQUM1RSxPQUFPLEVBQUMsVUFBVSxFQUFnQixXQUFXLEVBQUMsTUFBTSxzQkFBc0IsQ0FBQztBQUUzRSxPQUFPLEVBQUMsVUFBVSxFQUFFLEVBQUUsRUFBQyxNQUFNLE1BQU0sQ0FBQztBQUNwQyxPQUFPLEVBQUMsVUFBVSxFQUFFLEdBQUcsRUFBQyxNQUFNLGdCQUFnQixDQUFDO0FBRS9DLE9BQU8sRUFBQyxVQUFVLEVBQUMsTUFBTSxlQUFlLENBQUM7QUFDekMsT0FBTyxFQUFDLFVBQVUsRUFBQyxNQUFNLDZCQUE2QixDQUFDO0FBQ3ZELE9BQU8sRUFBQyxnQkFBZ0IsRUFBQyxNQUFNLG1DQUFtQyxDQUFDOzs7QUFFbkUsTUFBTSxDQUFDLElBQUksMkJBQTJCLEdBQUcsSUFBSSxjQUFj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XNzaW9uLmluc3RhbmNlcyk7XHJcbiAgICAgICAgICB9KTtcclxuICAgICAgICB9XHJcbiAgICAgICAgcm9sZXMucHVzaChuZXcgUm9sZUVudGl0eShyb2xlLnJvbGVOYW1lLCBwZXJtaXNzaW9ucykpO1xyXG4gICAgICB9KTtcclxuICAgIH1cclxuXHJcbiAgICByZXR1cm4gbmV3IFVzZXJFbnRpdHkodXNlckpzb24uaWRVc2VyLCB1c2VySnNvbi51c2VybmFtZSwgcm9sZXMsIHVzZXJKc29uLmZpcnN0bmFtZSwgdXNlckpzb24ubGFzdG5hbWUsIHVzZXJKc29uLmhyZWYpO1xyXG4gIH1cclxuICBcclxuICBwdWJsaWMgZ2V0UGVybWlzc2lvbnMoZ292ZXJub3JDbGFzczogc3RyaW5nLCBnb3Zlcm5vcklkOiBudW1iZXIsIGdvdmVybmVkQ2xhc3M6IHN0cmluZyk6IE9ic2VydmFibGU8YW55PiAge1xyXG4gICAgICBsZXQgaGVhZGVycyA9IG5ldyBIdHRwSGVhZGVycygpXHJcbiAgICAgIC5zZXQoXCJTZWN1cml0eUdvdmVybm9yQ2xhc3NcIiwgZ292ZXJub3JDbGFzcykuc2V0KFwiU2VjdXJpdHlHb3Zlcm5vcklkXCIsIFN0cmluZyhnb3Zlcm5vcklkKSk7XHJcbiAgICAgIHJldHVybiB0aGlzLl9odHRwLmdldChcIi9jb3JlL2FwaS91c2VyL3Blcm1pc3Npb25zL1wiICsgZ292ZXJuZWRDbGFzcywge2hlYWRlcnM6IGhlYWRlcnN9KTtcclxuICB9XHJcbn1cclxuIl19
|
|
@@ -1,427 +0,0 @@
|
|
|
1
|
-
import * as i0 from '@angular/core';
|
|
2
|
-
import { InjectionToken, isDevMode, Injectable, Inject, Directive, Input, NgModule } from '@angular/core';
|
|
3
|
-
import { CommonModule } from '@angular/common';
|
|
4
|
-
import { ReactiveFormsModule, FormsModule } from '@angular/forms';
|
|
5
|
-
import * as i1 from '@angular/common/http';
|
|
6
|
-
import { HttpHeaders } from '@angular/common/http';
|
|
7
|
-
import { of, Observable } from 'rxjs';
|
|
8
|
-
import { map, catchError } from 'rxjs/operators';
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* An immutable representation of an HCI user entity.
|
|
12
|
-
*
|
|
13
|
-
* @since 1.0.0
|
|
14
|
-
*/
|
|
15
|
-
class UserEntity {
|
|
16
|
-
constructor(id, username, roles, firstname, lastname, href) {
|
|
17
|
-
this.id = id;
|
|
18
|
-
this.username = username;
|
|
19
|
-
this.roles = roles;
|
|
20
|
-
this.firstname = firstname;
|
|
21
|
-
this.lastname = lastname;
|
|
22
|
-
this.href = href;
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* An accessor for the users system id.
|
|
26
|
-
*
|
|
27
|
-
* @returns {string} the system id
|
|
28
|
-
* @constructor
|
|
29
|
-
*/
|
|
30
|
-
get Id() {
|
|
31
|
-
return this.id;
|
|
32
|
-
}
|
|
33
|
-
/**
|
|
34
|
-
* An accessor for the users application identifier/username.
|
|
35
|
-
*
|
|
36
|
-
* @returns {string} the application id/username
|
|
37
|
-
* @constructor
|
|
38
|
-
*/
|
|
39
|
-
get Username() {
|
|
40
|
-
return this.username;
|
|
41
|
-
}
|
|
42
|
-
/**
|
|
43
|
-
* An accessor for the users assigned role authorization claims.
|
|
44
|
-
*
|
|
45
|
-
* @returns {@code RoleEntity[]} the role authorization claims
|
|
46
|
-
* @constructor
|
|
47
|
-
*/
|
|
48
|
-
get Roles() {
|
|
49
|
-
return this.roles;
|
|
50
|
-
}
|
|
51
|
-
/**
|
|
52
|
-
* An accessor for the users firstname.
|
|
53
|
-
*
|
|
54
|
-
* @return {string} the firstname
|
|
55
|
-
* @constructor
|
|
56
|
-
*/
|
|
57
|
-
get Firstname() {
|
|
58
|
-
return this.firstname;
|
|
59
|
-
}
|
|
60
|
-
/**
|
|
61
|
-
* A accessor for the users lastname.
|
|
62
|
-
*
|
|
63
|
-
* @return {string} the lastname
|
|
64
|
-
* @constructor
|
|
65
|
-
*/
|
|
66
|
-
get Lastname() {
|
|
67
|
-
return this.lastname;
|
|
68
|
-
}
|
|
69
|
-
/**
|
|
70
|
-
* A access for the users fully qualified href location on the system.
|
|
71
|
-
*
|
|
72
|
-
* @return {string} the href location
|
|
73
|
-
* @constructor
|
|
74
|
-
*/
|
|
75
|
-
get Href() {
|
|
76
|
-
return this.href;
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
/**
|
|
81
|
-
* An immutable representation of an HCI role entity, which represents an authorization claim associated with an authenticated
|
|
82
|
-
* subject.
|
|
83
|
-
*
|
|
84
|
-
* @since 1.0.0
|
|
85
|
-
*/
|
|
86
|
-
class RoleEntity {
|
|
87
|
-
constructor(roleName, permissions) {
|
|
88
|
-
this.roleName = roleName;
|
|
89
|
-
this.permissions = permissions;
|
|
90
|
-
}
|
|
91
|
-
/**
|
|
92
|
-
* An accessor for the name of this role.
|
|
93
|
-
*
|
|
94
|
-
* @returns {string} the role name
|
|
95
|
-
* @constructor
|
|
96
|
-
*/
|
|
97
|
-
get RoleName() {
|
|
98
|
-
return this.roleName;
|
|
99
|
-
}
|
|
100
|
-
/**
|
|
101
|
-
* An accessor for a collection of {@link PermissionEntity} authorization claims that define this role. Permissions
|
|
102
|
-
* provide a finer grained authorization claim description and are not required.
|
|
103
|
-
*
|
|
104
|
-
* @returns {PermissionEntity[]} a collection of permission entities
|
|
105
|
-
* @constructor
|
|
106
|
-
*/
|
|
107
|
-
get Permissions() {
|
|
108
|
-
return this.permissions;
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
/*
|
|
113
|
-
* Copyright (c) 2016 Huntsman Cancer Institute at the University of Utah, Confidential and Proprietary
|
|
114
|
-
*/
|
|
115
|
-
/**
|
|
116
|
-
* An immutable representation of an HCI permission entity, which represents a fine grained authorization claim that can
|
|
117
|
-
* define a {@link RoleEntity}.
|
|
118
|
-
*
|
|
119
|
-
* @since 1.0.0
|
|
120
|
-
*/
|
|
121
|
-
class PermissionEntity {
|
|
122
|
-
constructor(domain, actions, instances) {
|
|
123
|
-
this.domain = domain;
|
|
124
|
-
this.actions = actions;
|
|
125
|
-
this.instances = instances;
|
|
126
|
-
}
|
|
127
|
-
/**
|
|
128
|
-
* An accessor for the domain this permission is defined for (i.e. user, study, specimen, etc...).
|
|
129
|
-
*
|
|
130
|
-
* @returns {string} the domain of this permission
|
|
131
|
-
* @constructor
|
|
132
|
-
*/
|
|
133
|
-
get Domain() {
|
|
134
|
-
return this.domain;
|
|
135
|
-
}
|
|
136
|
-
/**
|
|
137
|
-
* An accessor for the actions that this permission allows in the specified domain (i.e. create, read, activate, manage
|
|
138
|
-
* etc...). If no actions are defined, this permission claims access to all actions of the specified domain.
|
|
139
|
-
*
|
|
140
|
-
* @returns {string[]} an array of actions for the specified domain
|
|
141
|
-
* @constructor
|
|
142
|
-
*/
|
|
143
|
-
get Actions() {
|
|
144
|
-
return this.actions;
|
|
145
|
-
}
|
|
146
|
-
/**
|
|
147
|
-
* An accessor for the instances that this permission is applicable to in the specified domain (i.e. joe, 1234, study-foo,
|
|
148
|
-
* etc...). If no instances are defined, this permission claims applicability to all instances of the specified domain.
|
|
149
|
-
* @returns {string[]}
|
|
150
|
-
* @constructor
|
|
151
|
-
*/
|
|
152
|
-
get Instances() {
|
|
153
|
-
return this.instances;
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
/*
|
|
158
|
-
* Copyright (c) 2016 Huntsman Cancer Institute at the University of Utah, Confidential and Proprietary
|
|
159
|
-
*/
|
|
160
|
-
let AUTHENTICATED_USER_ENDPOINT = new InjectionToken("authenticated_user_url");
|
|
161
|
-
/**
|
|
162
|
-
* @since 1.0.0
|
|
163
|
-
*/
|
|
164
|
-
class UserService {
|
|
165
|
-
constructor(_http, _authenticationUserEndpoint) {
|
|
166
|
-
this._http = _http;
|
|
167
|
-
this._authenticationUserEndpoint = _authenticationUserEndpoint;
|
|
168
|
-
this._authenticatedUser = null;
|
|
169
|
-
}
|
|
170
|
-
/**
|
|
171
|
-
* An accessor for an {@code Observable<UserEntity>} reflecting the currently authenticated user. If no subject is
|
|
172
|
-
* available, the appropriate response status should be returned from the server to indicate that condition
|
|
173
|
-
* (i.e. 404 - Not Found).
|
|
174
|
-
*
|
|
175
|
-
* @returns {Observable<UserEntity>} the currently authenticated user representation
|
|
176
|
-
*/
|
|
177
|
-
getAuthenticatedUser() {
|
|
178
|
-
if (isDevMode() && console && console.debug) {
|
|
179
|
-
console.debug("getAuthenticatedUser");
|
|
180
|
-
}
|
|
181
|
-
if (!this._authenticatedUser) {
|
|
182
|
-
if (isDevMode() && console && console.debug) {
|
|
183
|
-
console.debug("_authenticationUserEndpoint: " + this._authenticationUserEndpoint);
|
|
184
|
-
}
|
|
185
|
-
return this._http.get(this._authenticationUserEndpoint, { observe: "response" }).pipe(map((resp) => {
|
|
186
|
-
if (resp.status === 200) {
|
|
187
|
-
this._authenticatedUser = this.buildUserEntity(resp.body);
|
|
188
|
-
return this._authenticatedUser;
|
|
189
|
-
}
|
|
190
|
-
else {
|
|
191
|
-
throw new Error("Get authenticated user failed. " + resp.status + ": " + resp.statusText);
|
|
192
|
-
}
|
|
193
|
-
}), catchError(this.handleError));
|
|
194
|
-
}
|
|
195
|
-
else {
|
|
196
|
-
return of(this._authenticatedUser);
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
handleError(error) {
|
|
200
|
-
let errMsg = (error.message) ? error.message : UserService.GENERIC_ERR_MSG;
|
|
201
|
-
return Observable.throw(errMsg);
|
|
202
|
-
}
|
|
203
|
-
/**
|
|
204
|
-
* TODO: Add in a deserializer into the entity.
|
|
205
|
-
*
|
|
206
|
-
* @param userJson
|
|
207
|
-
* @returns {UserEntity}
|
|
208
|
-
*/
|
|
209
|
-
buildUserEntity(userJson) {
|
|
210
|
-
let roles = [];
|
|
211
|
-
if (userJson.roles) {
|
|
212
|
-
userJson.roles.map((role) => {
|
|
213
|
-
let permissions;
|
|
214
|
-
if (role.permissions) {
|
|
215
|
-
/* TODO: JEH (10/27/16) - Revisit when we determine how permission are communicated to the client, if necessary */
|
|
216
|
-
permissions = role.permissions.map((permission) => {
|
|
217
|
-
return new PermissionEntity(permission.domain, permission.actions, permission.instances);
|
|
218
|
-
});
|
|
219
|
-
}
|
|
220
|
-
roles.push(new RoleEntity(role.roleName, permissions));
|
|
221
|
-
});
|
|
222
|
-
}
|
|
223
|
-
return new UserEntity(userJson.idUser, userJson.username, roles, userJson.firstname, userJson.lastname, userJson.href);
|
|
224
|
-
}
|
|
225
|
-
getPermissions(governorClass, governorId, governedClass) {
|
|
226
|
-
let headers = new HttpHeaders()
|
|
227
|
-
.set("SecurityGovernorClass", governorClass).set("SecurityGovernorId", String(governorId));
|
|
228
|
-
return this._http.get("/core/api/user/permissions/" + governedClass, { headers: headers });
|
|
229
|
-
}
|
|
230
|
-
}
|
|
231
|
-
/**
|
|
232
|
-
* The generic error message used when a server error is thrown without a status.
|
|
233
|
-
*
|
|
234
|
-
* @type {string}
|
|
235
|
-
*/
|
|
236
|
-
UserService.GENERIC_ERR_MSG = "Server error";
|
|
237
|
-
UserService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: UserService, deps: [{ token: i1.HttpClient }, { token: AUTHENTICATED_USER_ENDPOINT }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
238
|
-
UserService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: UserService });
|
|
239
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: UserService, decorators: [{
|
|
240
|
-
type: Injectable
|
|
241
|
-
}], ctorParameters: function () {
|
|
242
|
-
return [{ type: i1.HttpClient }, { type: undefined, decorators: [{
|
|
243
|
-
type: Inject,
|
|
244
|
-
args: [AUTHENTICATED_USER_ENDPOINT]
|
|
245
|
-
}] }];
|
|
246
|
-
} });
|
|
247
|
-
|
|
248
|
-
/*
|
|
249
|
-
* Copyright (c) 2016 Huntsman Cancer Institute at the University of Utah, Confidential and Proprietary
|
|
250
|
-
*/
|
|
251
|
-
/**
|
|
252
|
-
* A structural directive for adding and removing elements of the client application based on a users <em>role</em>
|
|
253
|
-
* authorization claims.
|
|
254
|
-
*
|
|
255
|
-
* This directive requires the {@link UserService} as a provider.
|
|
256
|
-
*
|
|
257
|
-
* @since 1.0.0
|
|
258
|
-
*/
|
|
259
|
-
class RoleCheckDirective {
|
|
260
|
-
constructor(_viewContainer, _templateRef, _usrSvc) {
|
|
261
|
-
this._viewContainer = _viewContainer;
|
|
262
|
-
this._templateRef = _templateRef;
|
|
263
|
-
this._usrSvc = _usrSvc;
|
|
264
|
-
this._lastCheck = null;
|
|
265
|
-
}
|
|
266
|
-
/**
|
|
267
|
-
* Calculates the availability of a decorated element based on the authenticated users available roles.
|
|
268
|
-
*
|
|
269
|
-
* @param roleName for the role required to make the decorated element available
|
|
270
|
-
*/
|
|
271
|
-
set hciHasRole(roleName) {
|
|
272
|
-
if (isDevMode() && console && console.debug) {
|
|
273
|
-
console.debug("hciHasRole");
|
|
274
|
-
}
|
|
275
|
-
this._usrSvc.getAuthenticatedUser().subscribe((authUser) => {
|
|
276
|
-
let found;
|
|
277
|
-
if (authUser && authUser.Roles) {
|
|
278
|
-
found = authUser.Roles.some((role) => {
|
|
279
|
-
return role.RoleName === roleName;
|
|
280
|
-
});
|
|
281
|
-
}
|
|
282
|
-
else {
|
|
283
|
-
found = false;
|
|
284
|
-
}
|
|
285
|
-
if (found && (this._lastCheck === null || !this._lastCheck)) {
|
|
286
|
-
this._viewContainer.createEmbeddedView(this._templateRef);
|
|
287
|
-
}
|
|
288
|
-
else if (!found && (this._lastCheck === null || this._lastCheck)) {
|
|
289
|
-
this._viewContainer.clear();
|
|
290
|
-
}
|
|
291
|
-
}, (error) => {
|
|
292
|
-
// TODO: BHY (08/19/16) - Determine requirements around errors and then REMOVE CONSOLE LOGGING. Display to user,
|
|
293
|
-
// log to external source, gobble?
|
|
294
|
-
// Gobble up the error.
|
|
295
|
-
});
|
|
296
|
-
}
|
|
297
|
-
}
|
|
298
|
-
RoleCheckDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: RoleCheckDirective, deps: [{ token: i0.ViewContainerRef }, { token: i0.TemplateRef }, { token: UserService }], target: i0.ɵɵFactoryTarget.Directive });
|
|
299
|
-
RoleCheckDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.10", type: RoleCheckDirective, selector: "[hciHasRole]", inputs: { hciHasRole: "hciHasRole" }, providers: [UserService], ngImport: i0 });
|
|
300
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: RoleCheckDirective, decorators: [{
|
|
301
|
-
type: Directive,
|
|
302
|
-
args: [{
|
|
303
|
-
selector: "[hciHasRole]",
|
|
304
|
-
providers: [UserService]
|
|
305
|
-
}]
|
|
306
|
-
}], ctorParameters: function () { return [{ type: i0.ViewContainerRef }, { type: i0.TemplateRef }, { type: UserService }]; }, propDecorators: { hciHasRole: [{
|
|
307
|
-
type: Input
|
|
308
|
-
}] } });
|
|
309
|
-
|
|
310
|
-
/*
|
|
311
|
-
* Copyright (c) 2016 Huntsman Cancer Institute at the University of Utah, Confidential and Proprietary
|
|
312
|
-
*/
|
|
313
|
-
/**
|
|
314
|
-
* An extension of the {@link RoleCheckDirective} the only evaluates the role if is it not null or undefined.
|
|
315
|
-
*
|
|
316
|
-
* This directive requires the {@link UserService} as a provider.
|
|
317
|
-
*
|
|
318
|
-
* @since 1.0.0
|
|
319
|
-
*/
|
|
320
|
-
class RoleCheckUnlessNullDirective extends RoleCheckDirective {
|
|
321
|
-
constructor(_viewContainer, _templateRef, _usrSvc) {
|
|
322
|
-
super(_viewContainer, _templateRef, _usrSvc);
|
|
323
|
-
this._context = new HciHasRoleUnlessNullContext();
|
|
324
|
-
}
|
|
325
|
-
set hciHasRoleUnlessNull(roleName) {
|
|
326
|
-
if (!roleName) {
|
|
327
|
-
// if the roleName is undefined or null then render
|
|
328
|
-
if (this._context._condition !== true) {
|
|
329
|
-
this._context._condition = true;
|
|
330
|
-
this._updateView();
|
|
331
|
-
}
|
|
332
|
-
}
|
|
333
|
-
else {
|
|
334
|
-
// otherwise delegate the check to RoleCheckDirective
|
|
335
|
-
this.hciHasRole = roleName;
|
|
336
|
-
}
|
|
337
|
-
}
|
|
338
|
-
_updateView() {
|
|
339
|
-
this._viewContainer.clear();
|
|
340
|
-
if (this._context._condition) {
|
|
341
|
-
this._viewContainer.createEmbeddedView(this._templateRef, this._context);
|
|
342
|
-
}
|
|
343
|
-
else {
|
|
344
|
-
this._viewContainer.createEmbeddedView(this._templateRef, this._context);
|
|
345
|
-
}
|
|
346
|
-
}
|
|
347
|
-
}
|
|
348
|
-
RoleCheckUnlessNullDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: RoleCheckUnlessNullDirective, deps: [{ token: i0.ViewContainerRef }, { token: i0.TemplateRef }, { token: UserService }], target: i0.ɵɵFactoryTarget.Directive });
|
|
349
|
-
RoleCheckUnlessNullDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.10", type: RoleCheckUnlessNullDirective, selector: "[hciHasRoleUnlessNull]", inputs: { hciHasRoleUnlessNull: "hciHasRoleUnlessNull" }, usesInheritance: true, ngImport: i0 });
|
|
350
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: RoleCheckUnlessNullDirective, decorators: [{
|
|
351
|
-
type: Directive,
|
|
352
|
-
args: [{
|
|
353
|
-
selector: "[hciHasRoleUnlessNull]"
|
|
354
|
-
}]
|
|
355
|
-
}], ctorParameters: function () { return [{ type: i0.ViewContainerRef }, { type: i0.TemplateRef }, { type: UserService }]; }, propDecorators: { hciHasRoleUnlessNull: [{
|
|
356
|
-
type: Input
|
|
357
|
-
}] } });
|
|
358
|
-
/**
|
|
359
|
-
* I totally ripped off *ngIf source to get this to work correctly to prevent infinit loop rendering.
|
|
360
|
-
*/
|
|
361
|
-
class HciHasRoleUnlessNullContext {
|
|
362
|
-
constructor() {
|
|
363
|
-
this._condition = false;
|
|
364
|
-
}
|
|
365
|
-
}
|
|
366
|
-
|
|
367
|
-
/*
|
|
368
|
-
* Copyright (c) 2016 Huntsman Cancer Institute at the University of Utah, Confidential and Proprietary
|
|
369
|
-
*/
|
|
370
|
-
/**
|
|
371
|
-
* A feature module for user related services, directives, pipes, etc...
|
|
372
|
-
*
|
|
373
|
-
* @since 1.0.0
|
|
374
|
-
*/
|
|
375
|
-
class UserModule {
|
|
376
|
-
static forRoot() {
|
|
377
|
-
return {
|
|
378
|
-
providers: [
|
|
379
|
-
UserService
|
|
380
|
-
],
|
|
381
|
-
ngModule: UserModule
|
|
382
|
-
};
|
|
383
|
-
}
|
|
384
|
-
}
|
|
385
|
-
UserModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: UserModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
386
|
-
UserModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.10", ngImport: i0, type: UserModule, declarations: [RoleCheckDirective,
|
|
387
|
-
RoleCheckUnlessNullDirective], imports: [CommonModule,
|
|
388
|
-
ReactiveFormsModule,
|
|
389
|
-
FormsModule], exports: [RoleCheckDirective,
|
|
390
|
-
RoleCheckUnlessNullDirective] });
|
|
391
|
-
UserModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: UserModule, imports: [CommonModule,
|
|
392
|
-
ReactiveFormsModule,
|
|
393
|
-
FormsModule] });
|
|
394
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: UserModule, decorators: [{
|
|
395
|
-
type: NgModule,
|
|
396
|
-
args: [{
|
|
397
|
-
imports: [
|
|
398
|
-
CommonModule,
|
|
399
|
-
ReactiveFormsModule,
|
|
400
|
-
FormsModule
|
|
401
|
-
],
|
|
402
|
-
declarations: [
|
|
403
|
-
RoleCheckDirective,
|
|
404
|
-
RoleCheckUnlessNullDirective
|
|
405
|
-
],
|
|
406
|
-
exports: [
|
|
407
|
-
RoleCheckDirective,
|
|
408
|
-
RoleCheckUnlessNullDirective
|
|
409
|
-
]
|
|
410
|
-
}]
|
|
411
|
-
}] });
|
|
412
|
-
|
|
413
|
-
/*
|
|
414
|
-
* Copyright (c) 2016 Huntsman Cancer Institute at the University of Utah, Confidential and Proprietary
|
|
415
|
-
*/
|
|
416
|
-
/**
|
|
417
|
-
* A barrel file for the HCI ng2 user package.
|
|
418
|
-
*
|
|
419
|
-
* @since 1.0.0
|
|
420
|
-
*/
|
|
421
|
-
|
|
422
|
-
/**
|
|
423
|
-
* Generated bundle index. Do not edit.
|
|
424
|
-
*/
|
|
425
|
-
|
|
426
|
-
export { AUTHENTICATED_USER_ENDPOINT, PermissionEntity, RoleCheckDirective, RoleCheckUnlessNullDirective, RoleEntity, UserEntity, UserModule, UserService };
|
|
427
|
-
//# sourceMappingURL=huntsman-cancer-institute-user.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"huntsman-cancer-institute-user.mjs","sources":["../../../projects/user/src/user.entity.ts","../../../projects/user/src/authorization/role.entity.ts","../../../projects/user/src/authorization/permission.entity.ts","../../../projects/user/src/user.service.ts","../../../projects/user/src/authorization/role-check.directive.ts","../../../projects/user/src/authorization/role-check-unless-null.directive.ts","../../../projects/user/src/user.module.ts","../../../projects/user/src/index.ts","../../../projects/user/src/huntsman-cancer-institute-user.ts"],"sourcesContent":["/*\r\n * Copyright (c) 2016 Huntsman Cancer Institute at the University of Utah, Confidential and Proprietary\r\n */\r\nimport {RoleEntity} from \"./authorization/role.entity\";\r\n\r\n/**\r\n * An immutable representation of an HCI user entity.\r\n *\r\n * @since 1.0.0\r\n */\r\nexport class UserEntity {\r\n constructor(private id: string,\r\n private username: string,\r\n private roles?: RoleEntity[],\r\n private firstname?: string,\r\n private lastname?: string,\r\n private href?: string) {\r\n }\r\n\r\n /**\r\n * An accessor for the users system id.\r\n *\r\n * @returns {string} the system id\r\n * @constructor\r\n */\r\n get Id(): string {\r\n return this.id;\r\n }\r\n\r\n /**\r\n * An accessor for the users application identifier/username.\r\n *\r\n * @returns {string} the application id/username\r\n * @constructor\r\n */\r\n get Username(): string {\r\n return this.username;\r\n }\r\n\r\n /**\r\n * An accessor for the users assigned role authorization claims.\r\n *\r\n * @returns {@code RoleEntity[]} the role authorization claims\r\n * @constructor\r\n */\r\n get Roles(): RoleEntity[] {\r\n return this.roles;\r\n }\r\n\r\n /**\r\n * An accessor for the users firstname.\r\n *\r\n * @return {string} the firstname\r\n * @constructor\r\n */\r\n get Firstname(): string {\r\n return this.firstname;\r\n }\r\n\r\n /**\r\n * A accessor for the users lastname.\r\n *\r\n * @return {string} the lastname\r\n * @constructor\r\n */\r\n get Lastname(): string {\r\n return this.lastname;\r\n }\r\n\r\n /**\r\n * A access for the users fully qualified href location on the system.\r\n *\r\n * @return {string} the href location\r\n * @constructor\r\n */\r\n get Href(): string {\r\n return this.href;\r\n }\r\n\r\n}\r\n","/*\r\n * Copyright (c) 2016 Huntsman Cancer Institute at the University of Utah, Confidential and Proprietary\r\n */\r\nimport {PermissionEntity} from \"./permission.entity\";\r\n\r\n/**\r\n * An immutable representation of an HCI role entity, which represents an authorization claim associated with an authenticated\r\n * subject.\r\n *\r\n * @since 1.0.0\r\n */\r\nexport class RoleEntity {\r\n constructor( private roleName: string, private permissions?: PermissionEntity[]) {}\r\n\r\n /**\r\n * An accessor for the name of this role.\r\n *\r\n * @returns {string} the role name\r\n * @constructor\r\n */\r\n get RoleName(): string {\r\n return this.roleName;\r\n }\r\n\r\n /**\r\n * An accessor for a collection of {@link PermissionEntity} authorization claims that define this role. Permissions\r\n * provide a finer grained authorization claim description and are not required.\r\n *\r\n * @returns {PermissionEntity[]} a collection of permission entities\r\n * @constructor\r\n */\r\n get Permissions(): PermissionEntity[] {\r\n return this.permissions;\r\n }\r\n}\r\n","/*\r\n * Copyright (c) 2016 Huntsman Cancer Institute at the University of Utah, Confidential and Proprietary\r\n */\r\n/**\r\n * An immutable representation of an HCI permission entity, which represents a fine grained authorization claim that can\r\n * define a {@link RoleEntity}.\r\n *\r\n * @since 1.0.0\r\n */\r\nexport class PermissionEntity {\r\n constructor(private domain: string, private actions?: string[], private instances?: string[]) {\r\n }\r\n\r\n /**\r\n * An accessor for the domain this permission is defined for (i.e. user, study, specimen, etc...).\r\n *\r\n * @returns {string} the domain of this permission\r\n * @constructor\r\n */\r\n get Domain(): string {\r\n return this.domain;\r\n }\r\n\r\n /**\r\n * An accessor for the actions that this permission allows in the specified domain (i.e. create, read, activate, manage\r\n * etc...). If no actions are defined, this permission claims access to all actions of the specified domain.\r\n *\r\n * @returns {string[]} an array of actions for the specified domain\r\n * @constructor\r\n */\r\n get Actions(): string[] {\r\n return this.actions;\r\n }\r\n\r\n /**\r\n * An accessor for the instances that this permission is applicable to in the specified domain (i.e. joe, 1234, study-foo,\r\n * etc...). If no instances are defined, this permission claims applicability to all instances of the specified domain.\r\n * @returns {string[]}\r\n * @constructor\r\n */\r\n get Instances(): string[] {\r\n return this.instances;\r\n }\r\n}\r\n","/*\r\n * Copyright (c) 2016 Huntsman Cancer Institute at the University of Utah, Confidential and Proprietary\r\n */\r\nimport {Injectable, InjectionToken, Inject, isDevMode} from \"@angular/core\";\r\nimport {HttpClient, HttpResponse, HttpHeaders} from \"@angular/common/http\";\r\n\r\nimport {Observable, of} from \"rxjs\";\r\nimport {catchError, map} from \"rxjs/operators\";\r\n\r\nimport {UserEntity} from \"./user.entity\";\r\nimport {RoleEntity} from \"./authorization/role.entity\";\r\nimport {PermissionEntity} from \"./authorization/permission.entity\";\r\n\r\nexport let AUTHENTICATED_USER_ENDPOINT = new InjectionToken<string>(\"authenticated_user_url\");\r\n\r\n/**\r\n * @since 1.0.0\r\n */\r\n@Injectable()\r\nexport class UserService {\r\n /**\r\n * The generic error message used when a server error is thrown without a status.\r\n *\r\n * @type {string}\r\n */\r\n public static GENERIC_ERR_MSG: string = \"Server error\";\r\n\r\n private _authenticatedUser: UserEntity = null;\r\n\r\n constructor(private _http: HttpClient, @Inject(AUTHENTICATED_USER_ENDPOINT) private _authenticationUserEndpoint: string) {}\r\n\r\n /**\r\n * An accessor for an {@code Observable<UserEntity>} reflecting the currently authenticated user. If no subject is\r\n * available, the appropriate response status should be returned from the server to indicate that condition\r\n * (i.e. 404 - Not Found).\r\n *\r\n * @returns {Observable<UserEntity>} the currently authenticated user representation\r\n */\r\n public getAuthenticatedUser(): Observable<UserEntity> {\r\n if (isDevMode() && <any>console && <any>console.debug) {\r\n console.debug(\"getAuthenticatedUser\");\r\n }\r\n\r\n if (!this._authenticatedUser) {\r\n if (isDevMode() && <any>console && <any>console.debug) {\r\n console.debug(\"_authenticationUserEndpoint: \" + this._authenticationUserEndpoint);\r\n }\r\n\r\n return this._http.get(this._authenticationUserEndpoint, { observe: \"response\" }).pipe(map((resp: HttpResponse<any>) => {\r\n if (resp.status === 200) {\r\n this._authenticatedUser = this.buildUserEntity(resp.body);\r\n return this._authenticatedUser;\r\n } else {\r\n throw new Error(\"Get authenticated user failed. \" + resp.status + \": \" + resp.statusText);\r\n }\r\n }),\r\n catchError(this.handleError));\r\n } else {\r\n return of(this._authenticatedUser);\r\n }\r\n }\r\n\r\n private handleError(error: any) {\r\n let errMsg = (error.message) ? error.message : UserService.GENERIC_ERR_MSG;\r\n\r\n return Observable.throw(errMsg);\r\n }\r\n\r\n /**\r\n * TODO: Add in a deserializer into the entity.\r\n *\r\n * @param userJson\r\n * @returns {UserEntity}\r\n */\r\n private buildUserEntity(userJson: any): UserEntity {\r\n let roles: RoleEntity[] = [];\r\n if (userJson.roles) {\r\n userJson.roles.map((role: any) => {\r\n let permissions: PermissionEntity[];\r\n if (role.permissions) {\r\n /* TODO: JEH (10/27/16) - Revisit when we determine how permission are communicated to the client, if necessary */\r\n permissions = role.permissions.map((permission: any) => {\r\n return new PermissionEntity(permission.domain, permission.actions, permission.instances);\r\n });\r\n }\r\n roles.push(new RoleEntity(role.roleName, permissions));\r\n });\r\n }\r\n\r\n return new UserEntity(userJson.idUser, userJson.username, roles, userJson.firstname, userJson.lastname, userJson.href);\r\n }\r\n \r\n public getPermissions(governorClass: string, governorId: number, governedClass: string): Observable<any> {\r\n let headers = new HttpHeaders()\r\n .set(\"SecurityGovernorClass\", governorClass).set(\"SecurityGovernorId\", String(governorId));\r\n return this._http.get(\"/core/api/user/permissions/\" + governedClass, {headers: headers});\r\n }\r\n}\r\n","/*\r\n * Copyright (c) 2016 Huntsman Cancer Institute at the University of Utah, Confidential and Proprietary\r\n */\r\nimport {Directive, Input, TemplateRef, ViewContainerRef, isDevMode} from \"@angular/core\";\r\n\r\nimport {UserService} from \"../user.service\";\r\nimport {UserEntity} from \"../user.entity\";\r\n\r\n/**\r\n * A structural directive for adding and removing elements of the client application based on a users <em>role</em>\r\n * authorization claims.\r\n *\r\n * This directive requires the {@link UserService} as a provider.\r\n *\r\n * @since 1.0.0\r\n */\r\n@Directive({\r\n selector: \"[hciHasRole]\",\r\n providers: [UserService]\r\n})\r\nexport class RoleCheckDirective {\r\n protected _lastCheck: boolean = null;\r\n\r\n constructor(protected _viewContainer: ViewContainerRef,\r\n protected _templateRef: TemplateRef<Object>,\r\n protected _usrSvc: UserService) {\r\n }\r\n\r\n /**\r\n * Calculates the availability of a decorated element based on the authenticated users available roles.\r\n *\r\n * @param roleName for the role required to make the decorated element available\r\n */\r\n @Input()\r\n set hciHasRole(roleName: string) {\r\n if (isDevMode() && <any>console && <any>console.debug) {\r\n console.debug(\"hciHasRole\");\r\n }\r\n\r\n this._usrSvc.getAuthenticatedUser().subscribe((authUser: UserEntity) => {\r\n let found: boolean;\r\n\r\n if (authUser && authUser.Roles) {\r\n found = authUser.Roles.some((role) => {\r\n return role.RoleName === roleName;\r\n });\r\n } else {\r\n found = false;\r\n }\r\n\r\n if (found && (this._lastCheck === null || !this._lastCheck)) {\r\n this._viewContainer.createEmbeddedView(this._templateRef);\r\n } else if (!found && (this._lastCheck === null || this._lastCheck)) {\r\n this._viewContainer.clear();\r\n }\r\n }, (error) => {\r\n // TODO: BHY (08/19/16) - Determine requirements around errors and then REMOVE CONSOLE LOGGING. Display to user,\r\n // log to external source, gobble?\r\n // Gobble up the error.\r\n });\r\n }\r\n}\r\n\r\n","/*\r\n * Copyright (c) 2016 Huntsman Cancer Institute at the University of Utah, Confidential and Proprietary\r\n */\r\nimport {Directive, Input, ViewContainerRef, TemplateRef} from \"@angular/core\";\r\nimport {RoleCheckDirective} from \"./role-check.directive\";\r\nimport {UserService} from \"../user.service\";\r\n\r\n/**\r\n * An extension of the {@link RoleCheckDirective} the only evaluates the role if is it not null or undefined.\r\n *\r\n * This directive requires the {@link UserService} as a provider.\r\n *\r\n * @since 1.0.0\r\n */\r\n@Directive({\r\n selector: \"[hciHasRoleUnlessNull]\"\r\n})\r\nexport class RoleCheckUnlessNullDirective extends RoleCheckDirective {\r\n\r\n private _context: HciHasRoleUnlessNullContext = new HciHasRoleUnlessNullContext();\r\n\r\n constructor(\r\n _viewContainer: ViewContainerRef,\r\n _templateRef: TemplateRef<Object>,\r\n _usrSvc: UserService) {\r\n super(_viewContainer, _templateRef, _usrSvc);\r\n }\r\n\r\n @Input()\r\n set hciHasRoleUnlessNull(roleName: string) {\r\n if (!roleName) {\r\n // if the roleName is undefined or null then render\r\n if (this._context._condition !== true) {\r\n this._context._condition = true;\r\n this._updateView();\r\n }\r\n } else {\r\n // otherwise delegate the check to RoleCheckDirective\r\n this.hciHasRole = roleName;\r\n }\r\n }\r\n\r\n private _updateView() {\r\n this._viewContainer.clear();\r\n if (this._context._condition) {\r\n this._viewContainer.createEmbeddedView(this._templateRef, this._context);\r\n } else {\r\n this._viewContainer.createEmbeddedView(this._templateRef, this._context);\r\n }\r\n }\r\n}\r\n\r\n/**\r\n * I totally ripped off *ngIf source to get this to work correctly to prevent infinit loop rendering.\r\n */\r\nexport class HciHasRoleUnlessNullContext {\r\n public _condition: boolean = false;\r\n}\r\n","/*\r\n * Copyright (c) 2016 Huntsman Cancer Institute at the University of Utah, Confidential and Proprietary\r\n */\r\nimport {ModuleWithProviders, NgModule} from \"@angular/core\";\r\nimport {CommonModule} from \"@angular/common\";\r\nimport {ReactiveFormsModule, FormsModule} from \"@angular/forms\";\r\n\r\nimport {UserService} from \"./user.service\";\r\nimport {RoleCheckDirective} from \"./authorization/role-check.directive\";\r\nimport {RoleCheckUnlessNullDirective} from \"./authorization/role-check-unless-null.directive\";\r\n\r\n/**\r\n * A feature module for user related services, directives, pipes, etc...\r\n *\r\n * @since 1.0.0\r\n */\r\n@NgModule({\r\n imports: [\r\n CommonModule,\r\n ReactiveFormsModule,\r\n FormsModule\r\n ],\r\n declarations: [\r\n RoleCheckDirective,\r\n RoleCheckUnlessNullDirective\r\n ],\r\n exports: [\r\n RoleCheckDirective,\r\n RoleCheckUnlessNullDirective\r\n ]\r\n})\r\nexport class UserModule {\r\n static forRoot(): ModuleWithProviders<UserModule> {\r\n return {\r\n providers: [\r\n UserService\r\n ],\r\n ngModule: UserModule\r\n };\r\n }\r\n}\r\n","/*\r\n * Copyright (c) 2016 Huntsman Cancer Institute at the University of Utah, Confidential and Proprietary\r\n */\r\n\r\n/**\r\n * A barrel file for the HCI ng2 user package.\r\n *\r\n * @since 1.0.0\r\n */\r\nexport {UserModule} from \"./user.module\"\r\nexport {UserEntity} from \"./user.entity\"\r\nexport {RoleEntity} from \"./authorization/role.entity\"\r\nexport {PermissionEntity} from \"./authorization/permission.entity\"\r\n\r\n/**\r\n * The opaque tokens for service configuration.\r\n */\r\nexport {\r\n AUTHENTICATED_USER_ENDPOINT\r\n} from \"./user.service\"\r\n\r\nexport {UserService} from \"./user.service\"\r\n\r\nexport {RoleCheckDirective} from \"./authorization/role-check.directive\";\r\nexport {RoleCheckUnlessNullDirective} from \"./authorization/role-check-unless-null.directive\";\r\n\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1.UserService"],"mappings":";;;;;;;;;AAKA;;;;AAIG;MACU,UAAU,CAAA;IACrB,WAAoB,CAAA,EAAU,EACV,QAAgB,EAChB,KAAoB,EACpB,SAAkB,EAClB,QAAiB,EACjB,IAAa,EAAA;AALb,QAAA,IAAE,CAAA,EAAA,GAAF,EAAE,CAAQ;AACV,QAAA,IAAQ,CAAA,QAAA,GAAR,QAAQ,CAAQ;AAChB,QAAA,IAAK,CAAA,KAAA,GAAL,KAAK,CAAe;AACpB,QAAA,IAAS,CAAA,SAAA,GAAT,SAAS,CAAS;AAClB,QAAA,IAAQ,CAAA,QAAA,GAAR,QAAQ,CAAS;AACjB,QAAA,IAAI,CAAA,IAAA,GAAJ,IAAI,CAAS;KAChC;AAED;;;;;AAKG;AACH,IAAA,IAAI,EAAE,GAAA;QACJ,OAAO,IAAI,CAAC,EAAE,CAAC;KAChB;AAED;;;;;AAKG;AACH,IAAA,IAAI,QAAQ,GAAA;QACV,OAAO,IAAI,CAAC,QAAQ,CAAC;KACtB;AAED;;;;;AAKG;AACH,IAAA,IAAI,KAAK,GAAA;QACP,OAAO,IAAI,CAAC,KAAK,CAAC;KACnB;AAED;;;;;AAKG;AACH,IAAA,IAAI,SAAS,GAAA;QACX,OAAO,IAAI,CAAC,SAAS,CAAC;KACvB;AAED;;;;;AAKG;AACH,IAAA,IAAI,QAAQ,GAAA;QACV,OAAO,IAAI,CAAC,QAAQ,CAAC;KACtB;AAED;;;;;AAKG;AACH,IAAA,IAAI,IAAI,GAAA;QACN,OAAO,IAAI,CAAC,IAAI,CAAC;KAClB;AAEF;;AC1ED;;;;;AAKG;MACU,UAAU,CAAA;IACrB,WAAqB,CAAA,QAAgB,EAAU,WAAg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AA,YAAY,EAAE;wBACZ,kBAAkB;wBAClB,4BAA4B;AAC7B,qBAAA;AACD,oBAAA,OAAO,EAAE;wBACP,kBAAkB;wBAClB,4BAA4B;AAC7B,qBAAA;iBACF,CAAA;;;AC9BD;;AAEG;AAEH;;;;AAIG;;ACRH;;AAEG;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"huntsman-cancer-institute-user.mjs","sources":["../../../projects/user/src/user.entity.ts","../../../projects/user/src/authorization/role.entity.ts","../../../projects/user/src/authorization/permission.entity.ts","../../../projects/user/src/user.service.ts","../../../projects/user/src/authorization/role-check.directive.ts","../../../projects/user/src/authorization/role-check-unless-null.directive.ts","../../../projects/user/src/user.module.ts","../../../projects/user/src/index.ts","../../../projects/user/src/huntsman-cancer-institute-user.ts"],"sourcesContent":["/*\r\n * Copyright (c) 2016 Huntsman Cancer Institute at the University of Utah, Confidential and Proprietary\r\n */\r\nimport {RoleEntity} from \"./authorization/role.entity\";\r\n\r\n/**\r\n * An immutable representation of an HCI user entity.\r\n *\r\n * @since 1.0.0\r\n */\r\nexport class UserEntity {\r\n constructor(private id: string,\r\n private username: string,\r\n private roles?: RoleEntity[],\r\n private firstname?: string,\r\n private lastname?: string,\r\n private href?: string) {\r\n }\r\n\r\n /**\r\n * An accessor for the users system id.\r\n *\r\n * @returns {string} the system id\r\n * @constructor\r\n */\r\n get Id(): string {\r\n return this.id;\r\n }\r\n\r\n /**\r\n * An accessor for the users application identifier/username.\r\n *\r\n * @returns {string} the application id/username\r\n * @constructor\r\n */\r\n get Username(): string {\r\n return this.username;\r\n }\r\n\r\n /**\r\n * An accessor for the users assigned role authorization claims.\r\n *\r\n * @returns {@code RoleEntity[]} the role authorization claims\r\n * @constructor\r\n */\r\n get Roles(): RoleEntity[] {\r\n return this.roles;\r\n }\r\n\r\n /**\r\n * An accessor for the users firstname.\r\n *\r\n * @return {string} the firstname\r\n * @constructor\r\n */\r\n get Firstname(): string {\r\n return this.firstname;\r\n }\r\n\r\n /**\r\n * A accessor for the users lastname.\r\n *\r\n * @return {string} the lastname\r\n * @constructor\r\n */\r\n get Lastname(): string {\r\n return this.lastname;\r\n }\r\n\r\n /**\r\n * A access for the users fully qualified href location on the system.\r\n *\r\n * @return {string} the href location\r\n * @constructor\r\n */\r\n get Href(): string {\r\n return this.href;\r\n }\r\n\r\n}\r\n","/*\r\n * Copyright (c) 2016 Huntsman Cancer Institute at the University of Utah, Confidential and Proprietary\r\n */\r\nimport {PermissionEntity} from \"./permission.entity\";\r\n\r\n/**\r\n * An immutable representation of an HCI role entity, which represents an authorization claim associated with an authenticated\r\n * subject.\r\n *\r\n * @since 1.0.0\r\n */\r\nexport class RoleEntity {\r\n constructor( private roleName: string, private permissions?: PermissionEntity[]) {}\r\n\r\n /**\r\n * An accessor for the name of this role.\r\n *\r\n * @returns {string} the role name\r\n * @constructor\r\n */\r\n get RoleName(): string {\r\n return this.roleName;\r\n }\r\n\r\n /**\r\n * An accessor for a collection of {@link PermissionEntity} authorization claims that define this role. Permissions\r\n * provide a finer grained authorization claim description and are not required.\r\n *\r\n * @returns {PermissionEntity[]} a collection of permission entities\r\n * @constructor\r\n */\r\n get Permissions(): PermissionEntity[] {\r\n return this.permissions;\r\n }\r\n}\r\n","/*\r\n * Copyright (c) 2016 Huntsman Cancer Institute at the University of Utah, Confidential and Proprietary\r\n */\r\n/**\r\n * An immutable representation of an HCI permission entity, which represents a fine grained authorization claim that can\r\n * define a {@link RoleEntity}.\r\n *\r\n * @since 1.0.0\r\n */\r\nexport class PermissionEntity {\r\n constructor(private domain: string, private actions?: string[], private instances?: string[]) {\r\n }\r\n\r\n /**\r\n * An accessor for the domain this permission is defined for (i.e. user, study, specimen, etc...).\r\n *\r\n * @returns {string} the domain of this permission\r\n * @constructor\r\n */\r\n get Domain(): string {\r\n return this.domain;\r\n }\r\n\r\n /**\r\n * An accessor for the actions that this permission allows in the specified domain (i.e. create, read, activate, manage\r\n * etc...). If no actions are defined, this permission claims access to all actions of the specified domain.\r\n *\r\n * @returns {string[]} an array of actions for the specified domain\r\n * @constructor\r\n */\r\n get Actions(): string[] {\r\n return this.actions;\r\n }\r\n\r\n /**\r\n * An accessor for the instances that this permission is applicable to in the specified domain (i.e. joe, 1234, study-foo,\r\n * etc...). If no instances are defined, this permission claims applicability to all instances of the specified domain.\r\n * @returns {string[]}\r\n * @constructor\r\n */\r\n get Instances(): string[] {\r\n return this.instances;\r\n }\r\n}\r\n","/*\r\n * Copyright (c) 2016 Huntsman Cancer Institute at the University of Utah, Confidential and Proprietary\r\n */\r\nimport {Injectable, InjectionToken, Inject, isDevMode} from \"@angular/core\";\r\nimport {HttpClient, HttpResponse, HttpHeaders} from \"@angular/common/http\";\r\n\r\nimport {Observable, of} from \"rxjs\";\r\nimport {catchError, map} from \"rxjs/operators\";\r\n\r\nimport {UserEntity} from \"./user.entity\";\r\nimport {RoleEntity} from \"./authorization/role.entity\";\r\nimport {PermissionEntity} from \"./authorization/permission.entity\";\r\n\r\nexport let AUTHENTICATED_USER_ENDPOINT = new InjectionToken<string>(\"authenticated_user_url\");\r\n\r\n/**\r\n * @since 1.0.0\r\n */\r\n@Injectable()\r\nexport class UserService {\r\n /**\r\n * The generic error message used when a server error is thrown without a status.\r\n *\r\n * @type {string}\r\n */\r\n public static GENERIC_ERR_MSG: string = \"Server error\";\r\n\r\n private _authenticatedUser: UserEntity = null;\r\n\r\n constructor(private _http: HttpClient, @Inject(AUTHENTICATED_USER_ENDPOINT) private _authenticationUserEndpoint: string) {}\r\n\r\n /**\r\n * An accessor for an {@code Observable<UserEntity>} reflecting the currently authenticated user. If no subject is\r\n * available, the appropriate response status should be returned from the server to indicate that condition\r\n * (i.e. 404 - Not Found).\r\n *\r\n * @returns {Observable<UserEntity>} the currently authenticated user representation\r\n */\r\n public getAuthenticatedUser(): Observable<UserEntity> {\r\n if (isDevMode() && <any>console && <any>console.debug) {\r\n console.debug(\"getAuthenticatedUser\");\r\n }\r\n\r\n if (!this._authenticatedUser) {\r\n if (isDevMode() && <any>console && <any>console.debug) {\r\n console.debug(\"_authenticationUserEndpoint: \" + this._authenticationUserEndpoint);\r\n }\r\n\r\n return this._http.get(this._authenticationUserEndpoint, { observe: \"response\" }).pipe(map((resp: HttpResponse<any>) => {\r\n if (resp.status === 200) {\r\n this._authenticatedUser = this.buildUserEntity(resp.body);\r\n return this._authenticatedUser;\r\n } else {\r\n throw new Error(\"Get authenticated user failed. \" + resp.status + \": \" + resp.statusText);\r\n }\r\n }),\r\n catchError(this.handleError));\r\n } else {\r\n return of(this._authenticatedUser);\r\n }\r\n }\r\n\r\n private handleError(error: any) {\r\n let errMsg = (error.message) ? error.message : UserService.GENERIC_ERR_MSG;\r\n\r\n return Observable.throw(errMsg);\r\n }\r\n\r\n /**\r\n * TODO: Add in a deserializer into the entity.\r\n *\r\n * @param userJson\r\n * @returns {UserEntity}\r\n */\r\n private buildUserEntity(userJson: any): UserEntity {\r\n let roles: RoleEntity[] = [];\r\n if (userJson.roles) {\r\n userJson.roles.map((role: any) => {\r\n let permissions: PermissionEntity[];\r\n if (role.permissions) {\r\n /* TODO: JEH (10/27/16) - Revisit when we determine how permission are communicated to the client, if necessary */\r\n permissions = role.permissions.map((permission: any) => {\r\n return new PermissionEntity(permission.domain, permission.actions, permission.instances);\r\n });\r\n }\r\n roles.push(new RoleEntity(role.roleName, permissions));\r\n });\r\n }\r\n\r\n return new UserEntity(userJson.idUser, userJson.username, roles, userJson.firstname, userJson.lastname, userJson.href);\r\n }\r\n \r\n public getPermissions(governorClass: string, governorId: number, governedClass: string): Observable<any> {\r\n let headers = new HttpHeaders()\r\n .set(\"SecurityGovernorClass\", governorClass).set(\"SecurityGovernorId\", String(governorId));\r\n return this._http.get(\"/core/api/user/permissions/\" + governedClass, {headers: headers});\r\n }\r\n}\r\n","/*\r\n * Copyright (c) 2016 Huntsman Cancer Institute at the University of Utah, Confidential and Proprietary\r\n */\r\nimport {Directive, Input, TemplateRef, ViewContainerRef, isDevMode} from \"@angular/core\";\r\n\r\nimport {UserService} from \"../user.service\";\r\nimport {UserEntity} from \"../user.entity\";\r\n\r\n/**\r\n * A structural directive for adding and removing elements of the client application based on a users <em>role</em>\r\n * authorization claims.\r\n *\r\n * This directive requires the {@link UserService} as a provider.\r\n *\r\n * @since 1.0.0\r\n */\r\n@Directive({\r\n selector: \"[hciHasRole]\",\r\n providers: [UserService]\r\n})\r\nexport class RoleCheckDirective {\r\n protected _lastCheck: boolean = null;\r\n\r\n constructor(protected _viewContainer: ViewContainerRef,\r\n protected _templateRef: TemplateRef<Object>,\r\n protected _usrSvc: UserService) {\r\n }\r\n\r\n /**\r\n * Calculates the availability of a decorated element based on the authenticated users available roles.\r\n *\r\n * @param roleName for the role required to make the decorated element available\r\n */\r\n @Input()\r\n set hciHasRole(roleName: string) {\r\n if (isDevMode() && <any>console && <any>console.debug) {\r\n console.debug(\"hciHasRole\");\r\n }\r\n\r\n this._usrSvc.getAuthenticatedUser().subscribe((authUser: UserEntity) => {\r\n let found: boolean;\r\n\r\n if (authUser && authUser.Roles) {\r\n found = authUser.Roles.some((role) => {\r\n return role.RoleName === roleName;\r\n });\r\n } else {\r\n found = false;\r\n }\r\n\r\n if (found && (this._lastCheck === null || !this._lastCheck)) {\r\n this._viewContainer.createEmbeddedView(this._templateRef);\r\n } else if (!found && (this._lastCheck === null || this._lastCheck)) {\r\n this._viewContainer.clear();\r\n }\r\n }, (error) => {\r\n // TODO: BHY (08/19/16) - Determine requirements around errors and then REMOVE CONSOLE LOGGING. Display to user,\r\n // log to external source, gobble?\r\n // Gobble up the error.\r\n });\r\n }\r\n}\r\n\r\n","/*\r\n * Copyright (c) 2016 Huntsman Cancer Institute at the University of Utah, Confidential and Proprietary\r\n */\r\nimport {Directive, Input, ViewContainerRef, TemplateRef} from \"@angular/core\";\r\nimport {RoleCheckDirective} from \"./role-check.directive\";\r\nimport {UserService} from \"../user.service\";\r\n\r\n/**\r\n * An extension of the {@link RoleCheckDirective} the only evaluates the role if is it not null or undefined.\r\n *\r\n * This directive requires the {@link UserService} as a provider.\r\n *\r\n * @since 1.0.0\r\n */\r\n@Directive({\r\n selector: \"[hciHasRoleUnlessNull]\"\r\n})\r\nexport class RoleCheckUnlessNullDirective extends RoleCheckDirective {\r\n\r\n private _context: HciHasRoleUnlessNullContext = new HciHasRoleUnlessNullContext();\r\n\r\n constructor(\r\n _viewContainer: ViewContainerRef,\r\n _templateRef: TemplateRef<Object>,\r\n _usrSvc: UserService) {\r\n super(_viewContainer, _templateRef, _usrSvc);\r\n }\r\n\r\n @Input()\r\n set hciHasRoleUnlessNull(roleName: string) {\r\n if (!roleName) {\r\n // if the roleName is undefined or null then render\r\n if (this._context._condition !== true) {\r\n this._context._condition = true;\r\n this._updateView();\r\n }\r\n } else {\r\n // otherwise delegate the check to RoleCheckDirective\r\n this.hciHasRole = roleName;\r\n }\r\n }\r\n\r\n private _updateView() {\r\n this._viewContainer.clear();\r\n if (this._context._condition) {\r\n this._viewContainer.createEmbeddedView(this._templateRef, this._context);\r\n } else {\r\n this._viewContainer.createEmbeddedView(this._templateRef, this._context);\r\n }\r\n }\r\n}\r\n\r\n/**\r\n * I totally ripped off *ngIf source to get this to work correctly to prevent infinit loop rendering.\r\n */\r\nexport class HciHasRoleUnlessNullContext {\r\n public _condition: boolean = false;\r\n}\r\n","/*\r\n * Copyright (c) 2016 Huntsman Cancer Institute at the University of Utah, Confidential and Proprietary\r\n */\r\nimport {ModuleWithProviders, NgModule} from \"@angular/core\";\r\nimport {CommonModule} from \"@angular/common\";\r\nimport {ReactiveFormsModule, FormsModule} from \"@angular/forms\";\r\n\r\nimport {UserService} from \"./user.service\";\r\nimport {RoleCheckDirective} from \"./authorization/role-check.directive\";\r\nimport {RoleCheckUnlessNullDirective} from \"./authorization/role-check-unless-null.directive\";\r\n\r\n/**\r\n * A feature module for user related services, directives, pipes, etc...\r\n *\r\n * @since 1.0.0\r\n */\r\n@NgModule({\r\n imports: [\r\n CommonModule,\r\n ReactiveFormsModule,\r\n FormsModule\r\n ],\r\n declarations: [\r\n RoleCheckDirective,\r\n RoleCheckUnlessNullDirective\r\n ],\r\n exports: [\r\n RoleCheckDirective,\r\n RoleCheckUnlessNullDirective\r\n ]\r\n})\r\nexport class UserModule {\r\n static forRoot(): ModuleWithProviders<UserModule> {\r\n return {\r\n providers: [\r\n UserService\r\n ],\r\n ngModule: UserModule\r\n };\r\n }\r\n}\r\n","/*\r\n * Copyright (c) 2016 Huntsman Cancer Institute at the University of Utah, Confidential and Proprietary\r\n */\r\n\r\n/**\r\n * A barrel file for the HCI ng2 user package.\r\n *\r\n * @since 1.0.0\r\n */\r\nexport {UserModule} from \"./user.module\"\r\nexport {UserEntity} from \"./user.entity\"\r\nexport {RoleEntity} from \"./authorization/role.entity\"\r\nexport {PermissionEntity} from \"./authorization/permission.entity\"\r\n\r\n/**\r\n * The opaque tokens for service configuration.\r\n */\r\nexport {\r\n AUTHENTICATED_USER_ENDPOINT\r\n} from \"./user.service\"\r\n\r\nexport {UserService} from \"./user.service\"\r\n\r\nexport {RoleCheckDirective} from \"./authorization/role-check.directive\";\r\nexport {RoleCheckUnlessNullDirective} from \"./authorization/role-check-unless-null.directive\";\r\n\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1.UserService"],"mappings":";;;;;;;;;AAKA;;;;AAIG;MACU,UAAU,CAAA;IACrB,WAAoB,CAAA,EAAU,EACV,QAAgB,EAChB,KAAoB,EACpB,SAAkB,EAClB,QAAiB,EACjB,IAAa,EAAA;QALb,IAAE,CAAA,EAAA,GAAF,EAAE,CAAQ;QACV,IAAQ,CAAA,QAAA,GAAR,QAAQ,CAAQ;QAChB,IAAK,CAAA,KAAA,GAAL,KAAK,CAAe;QACpB,IAAS,CAAA,SAAA,GAAT,SAAS,CAAS;QAClB,IAAQ,CAAA,QAAA,GAAR,QAAQ,CAAS;QACjB,IAAI,CAAA,IAAA,GAAJ,IAAI,CAAS;KAChC;AAED;;;;;AAKG;AACH,IAAA,IAAI,EAAE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