@singularsystems/neo-authorisation

Client for neo authorisation server

Usage no npm install needed!

<script type="module">
  import singularsystemsNeoAuthorisation from 'https://cdn.skypack.dev/@singularsystems/neo-authorisation';
</script>

README

Neo Authorisation

The neo-authorisation package is the front ent client for the neo authorisation server service.

Setup

In your app setup, register the authorisation module:

import { AuthorisationAppModule } from '@singularsystems/neo-authorisation';

appService.registerModule(AuthorisationAppModule);

Config

Add the following to your main config model:

import { IAuthorisationConfig } from '@singularsystems/neo-authorisation';

public get authorisationConfig(): IAuthorisationConfig {
    return {
        authorisationServerApiPath: this.authorisationServerApi.apiPath
    }
}

Then register the config in your app module:

import { AuthorisationTypes } from '@singularsystems/neo-authorisation';

container.bindConfig(AuthorisationTypes.ConfigModel, (c: Config) => c.authorisationConfig);

View

Add the authorisation route to your routes service:

import { SecurityRoute } from '@singularsystems/neo-authorisation';

or

Create a route referencing the security view:

import { AuthorisationRoles, UserGroupsView } from '@singularsystems/neo-authorisation';

const SecurityRoute = { 
    name: "User Access", 
    path: "/security/useraccess", 
    component: UserGroupsView, 
    role: AuthorisationRoles.UserAccess.Access }

Add the styles to your app component:

import "@singularsystems/neo-authorisation/styles/authorisation.scss";