This file contains hidden or 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
const appRoutes: Routes = [ | |
{ | |
path: 'crisis-center', component: CrisisListComponent, | |
canActivate: [CanActivateGuard], | |
data: { | |
permissions: ['CRISIS_READ'] | |
} | |
}, | |
{ | |
path: 'hero/:id', |
This file contains hidden or 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
canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<boolean> | Promise<boolean> | boolean { | |
if (route.component && route.data) { | |
let permissions = route.data.permissions; | |
if (permissions) { | |
return this.securityService.userHasPermissions(permissions) | |
.map(hasAccess => { | |
if (hasAccess) { | |
return true; | |
} | |
else { |
This file contains hidden or 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
const appRoutes: Routes = [ | |
{ | |
path: "", | |
canActivateChild: [CanActivateGuard], | |
children: [ | |
{ | |
path: 'crisis-center', component: CrisisListComponent, | |
}, | |
{ |
This file contains hidden or 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
export const ACTIVATE_FIELD_NAME = "__activate__"; | |
export function Activate(permissions: string[]) { | |
return function decorator(target) { | |
target[ACTIVATE_FIELD_NAME] = permissions; | |
} | |
} |
This file contains hidden or 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
@Activate(['HERO_READ']) | |
@Component({ | |
selector: 'hero-list', | |
template: ` | |
<ul > | |
<li *ngFor="let hero of heros"> | |
{{hero.name}} | |
</li> | |
</ul> |
This file contains hidden or 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
canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<boolean> | Promise<boolean> | boolean { | |
if (route.component && route.data) { | |
let permissions = route.component[ACTIVATE_FIELD_NAME] as ActivateMetadata; | |
if (permissions) { | |
return this.securityService.userHasPermissions(permissions) | |
.map(hasAccess => { | |
if (hasAccess) { | |
return true; | |
} | |
else { |
This file contains hidden or 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
./bin/connect-standalone etc/schema-registry/connect-avro-standalone.properties \ | |
etc/kafka-connect-elasticsearch/quickstart-elasticsearch.properties |
This file contains hidden or 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
topics=attack |
This file contains hidden or 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
key.converter=org.apache.kafka.connect.storage.StringConverter | |
internal.key.converter=org.apache.kafka.connect.storage.StringConverter |
This file contains hidden or 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
./bin/schema-registry-start etc/schema-registry/schema-registry.properties |