How to use ngx-permissions - 10 common examples

To help you get started, we’ve selected a few ngx-permissions examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Infosys / enterprise-angular-seed / src / app / app.module.ts View on Github external
import { ROUTES } from './app.routes';
import { PageNotFoundComponent } from './components/page-not-found/page-not-found.component';
import { HeaderComponent } from './components/header/header.component';
import { FooterComponent } from './components/footer/footer.component';

const DEFAULT_PERFECT_SCROLLBAR_CONFIG: PerfectScrollbarConfigInterface = {
  suppressScrollX: true
};

@NgModule({
  declarations: [AppComponent, HeaderComponent, FooterComponent, PageNotFoundComponent],
  imports: [
    BrowserModule,
    BrowserAnimationsModule,
    RouterModule.forRoot(ROUTES, { enableTracing: false }),
    NgxPermissionsModule.forRoot(),
    MenubarModule,
    PerfectScrollbarModule,
    // Bootstrap4FrameworkModule,
    // JsonSchemaFormModule.forRoot(Bootstrap4FrameworkModule),
    AppcommonModule
  ],
  providers: [
    {
      provide: PERFECT_SCROLLBAR_CONFIG,
      useValue: DEFAULT_PERFECT_SCROLLBAR_CONFIG
    }
  ],
  bootstrap: [AppComponent]
})
export class AppModule {}
github notadd / ng-notadd / src / app / app.module.ts View on Github external
@NgModule({
    declarations: [
        AppComponent
    ],
    imports: [
        BrowserModule,
        BrowserAnimationsModule,
        AngularFireModule.initializeApp(environment.firebase),
        MatIconModule,
        MatButtonModule,
        MatDialogModule,
        MatSnackBarModule,

        TranslateModule.forRoot(),
        NgxPermissionsModule.forRoot(),

        /* @notadd modules */
        NotaddModule.forRoot(notaddConfig),
        NotaddErrorsModule,
        NotaddMatIconsModule,
        NotaddProgressBarModule,
        NotaddSidebarModule,
        NotaddThemePanelModule,

        LayoutModule,

        GraphQLModule,

        HttpClientModule,

        AppRoutingModule,
github rucken / core / apps / demo / src / app / pages / account-page / account-page.module.ts View on Github external
import { NgModule } from '@angular/core';
import { RouterModule } from '@angular/router';
import { NavSidebarModule } from '@rucken/web';
import { NgxPermissionsModule } from 'ngx-permissions';
import { SharedModule } from '../../shared/shared.module';
import { AccountPageComponent } from './account-page.component';
import { ACCOUNT_PAGE_ROUTES } from './account-page.routes';

@NgModule({
  imports: [
    SharedModule,
    NgxPermissionsModule.forChild(),
    NavSidebarModule,
    RouterModule.forChild(ACCOUNT_PAGE_ROUTES)
  ],
  declarations: [AccountPageComponent]
})
export class AccountPageModule {}
github rucken / core / apps / demo / src / app / pages / entities-page / users-frame / users-frame.module.ts View on Github external
import { NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { RouterModule } from '@angular/router';
import { UsersGridModule } from '@rucken/web';
import { NgxPermissionsModule } from 'ngx-permissions';
import { SharedModule } from '../../../shared/shared.module';
import { UsersFrameComponent } from './users-frame.component';
import { USERS_FRAME_ROUTES } from './users-frame.routes';

@NgModule({
  imports: [
    SharedModule,
    NgxPermissionsModule.forChild(),
    RouterModule.forChild(USERS_FRAME_ROUTES),
    UsersGridModule,
    FormsModule
  ],
  declarations: [UsersFrameComponent]
})
export class UsersFrameModule {}
github AlexKhymenko / ngx-permissions / application / src / app / lazy-role-isolate / lazy-role-isolate.module.ts View on Github external
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { NgxPermissionsModule } from 'ngx-permissions';

import { LazyIsolateRolesRoutingModule } from './lazy-isolate-role-routing.module';
import { LazyRoleIsolateTestComponent } from './lazy-role-isolate-test/lazy-role-isolate-test.component';

@NgModule({
  imports: [
    CommonModule,
    LazyIsolateRolesRoutingModule,
    NgxPermissionsModule.forChild({
      permissionsIsolate: true,
      rolesIsolate: true,
      configurationIsolate: true
    })
  ],
  declarations: [
  LazyRoleIsolateTestComponent
  ]
})
export class LazyRoleIsolateModule { }
github rucken / core / apps / demo / src / app / pages / entities-page / entities-page.module.ts View on Github external
import { NgModule } from '@angular/core';
import { RouterModule } from '@angular/router';
import { NavSidebarModule } from '@rucken/web';
import { NgxPermissionsModule } from 'ngx-permissions';
import { SharedModule } from '../../shared/shared.module';
import { EntitiesPageComponent } from './entities-page.component';
import { ENTITIES_PAGE_ROUTES } from './entities-page.routes';

@NgModule({
  imports: [
    SharedModule,
    NgxPermissionsModule.forChild(),
    NavSidebarModule,
    RouterModule.forChild(ENTITIES_PAGE_ROUTES)
  ],
  declarations: [EntitiesPageComponent]
})
export class EntitiesPageModule {}
github AlexKhymenko / ngx-permissions / application / src / app / lazy-module / lazy-module.module.ts View on Github external
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { LazyRoutingModule } from './lazy-routing.module';
import { LazyComponentComponent } from './lazy-component/lazy-component.component';
import { NgxPermissionsModule } from 'ngx-permissions';

@NgModule({
  imports: [
    CommonModule,
    LazyRoutingModule,
    NgxPermissionsModule.forChild()

  ],
  declarations: [LazyComponentComponent]
})
export class LazyModule { }
github rucken / core / apps / demo / src / app / pages / account-page / profile-frame / profile-frame.module.ts View on Github external
import { NgModule } from '@angular/core';
import { RouterModule } from '@angular/router';
import { ProfilePanelModule } from '@rucken/web';
import { NgxPermissionsModule } from 'ngx-permissions';
import { SharedModule } from '../../../shared/shared.module';
import { ProfileFrameComponent } from './profile-frame.component';
import { PROFILE_FRAME_ROUTES } from './profile-frame.routes';

@NgModule({
  imports: [
    SharedModule,
    NgxPermissionsModule.forChild(),
    ProfilePanelModule,
    RouterModule.forChild(PROFILE_FRAME_ROUTES)
  ],
  declarations: [ProfileFrameComponent]
})
export class ProfileFrameModule {}
github rucken / core / apps / demo / src / app / pages / entities-page / groups-frame / groups-frame.module.ts View on Github external
import { NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { RouterModule } from '@angular/router';
import { GroupsGridModule } from '@rucken/web';
import { NgxPermissionsModule } from 'ngx-permissions';
import { SharedModule } from '../../../shared/shared.module';
import { GroupsFrameComponent } from './groups-frame.component';
import { GROUPS_FRAME_ROUTES } from './groups-frame.routes';

@NgModule({
  imports: [
    SharedModule,
    NgxPermissionsModule.forChild(),
    RouterModule.forChild(GROUPS_FRAME_ROUTES),
    GroupsGridModule,
    FormsModule
  ],
  declarations: [GroupsFrameComponent]
})
export class GroupsFrameModule {}
github rucken / core / apps / demo / src / app / pages / entities-page / permissions-frame / permissions-frame.module.ts View on Github external
import { NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { RouterModule } from '@angular/router';
import { PermissionsGridModule } from '@rucken/web';
import { NgxPermissionsModule } from 'ngx-permissions';
import { SharedModule } from '../../../shared/shared.module';
import { PermissionsFrameComponent } from './permissions-frame.component';
import { PERMISSIONS_FRAME_ROUTES } from './permissions-frame.routes';

@NgModule({
  imports: [
    SharedModule,
    NgxPermissionsModule.forChild(),
    RouterModule.forChild(PERMISSIONS_FRAME_ROUTES),
    PermissionsGridModule,
    FormsModule
  ],
  declarations: [PermissionsFrameComponent]
})
export class PermissionsFrameModule {}

ngx-permissions

Permission and roles based access control for your angular(angular 2,4,5,6,7,8+) applications(AOT, lazy modules compatible)

MIT
Latest version published 10 months ago

Package Health Score

66 / 100
Full package analysis