Created
May 23, 2019 13:28
-
-
Save Macadoshis/e10c6899a5d43b858508691a51158389 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Index: CMSS.Client/src/app/utils/router/cmss.router.types.ts | |
IDEA additional info: | |
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP | |
<+>UTF-8 | |
=================================================================== | |
--- CMSS.Client/src/app/utils/router/cmss.router.types.ts (date 1558607972000) | |
+++ CMSS.Client/src/app/utils/router/cmss.router.types.ts (date 1555529891368) | |
@@ -10,7 +10,7 @@ | |
protected _permissions: Permission[]; | |
- constructor(protected permissionService: PermissionService, permissions: Permission | Permission[]) { | |
+ constructor(protected permissionService: PermissionService, permissions: Permission | Permission[], private needsAll: boolean) { | |
if (!permissions) { | |
this._permissions = []; | |
} else if (!isArray(permissions)) { | |
@@ -21,14 +21,14 @@ | |
} | |
protected resolvePermissions(): Observable<boolean> { | |
- return this.permissionService.hasPermissions(this._permissions); | |
+ return this.permissionService.hasPermissions(this._permissions, !!this.needsAll); | |
} | |
} | |
export abstract class PermissionCanActivate extends PermissionObservable implements CanActivate { | |
- constructor(permissionService: PermissionService, permissions: Permission | Permission[]) { | |
- super(permissionService, permissions); | |
+ constructor(permissionService: PermissionService, permissions: Permission | Permission[], needsAll: boolean = false) { | |
+ super(permissionService, permissions, needsAll); | |
} | |
canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<boolean> { | |
@@ -38,8 +38,8 @@ | |
export abstract class PermissionResolver extends PermissionObservable implements Resolve<boolean> { | |
- constructor(permissionService: PermissionService, permissions: Permission | Permission[]) { | |
- super(permissionService, permissions); | |
+ constructor(permissionService: PermissionService, permissions: Permission | Permission[], needsAll: boolean = false) { | |
+ super(permissionService, permissions, needsAll); | |
} | |
resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<boolean> { |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment