Skip to content
This repository has been archived by the owner on Sep 7, 2022. It is now read-only.

Commit

Permalink
Merge pull request #20 from chihab/chore/fix-version-number
Browse files Browse the repository at this point in the history
chore: fix version number
  • Loading branch information
chihab authored Mar 28, 2021
2 parents f0f3fd8 + 05d8684 commit c66111b
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 63 deletions.
15 changes: 0 additions & 15 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
"start": "ng serve",
"lint": "ng lint core",
"build": "ng build --prod core",
"test": "ng test core --watch=false --browsers=ChromeHeadless"
"test": "ng test core --watch=false --browsers=ChromeHeadless",
"build:demo": "ng build --prod ngx-access"
},
"private": true,
"dependencies": {
Expand All @@ -20,8 +21,7 @@
"@angular/router": "~11.2.7",
"rxjs": "~6.6.0",
"tslib": "^2.0.0",
"zone.js": "~0.11.3",
"ngx-access": "~1.1.2"
"zone.js": "~0.11.3"
},
"devDependencies": {
"@angular-devkit/build-angular": "~0.1102.6",
Expand Down
2 changes: 1 addition & 1 deletion projects/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ngx-access",
"version": "0.0.1",
"version": "1.2.0",
"description": "Add access control to your components using hierarchical configuration with logical expressions.",
"author": "Chihab Otmani",
"repository": {
Expand Down
79 changes: 43 additions & 36 deletions src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,40 +10,47 @@ import { ProfileComponent } from './profile/profile.component';
import { UnauthorizedComponent } from './unauthorized/unauthorized.component';

@NgModule({
declarations: [
AppComponent, ProfileComponent, MainComponent, UnauthorizedComponent
],
imports: [
AccessModule.forRoot({
accesses: {
UserForm: {
FirstName: {
Read: 'UserAccess'
},
Login: {
Read: 'Adminccess'
}
}
},
redirect: '/forbidden',
strategy: { provide: AccessStrategy, useClass: MyAccessStrategy }
}),
RouterModule.forRoot([
{ path: '', component: MainComponent },
{ path: 'forbidden', component: UnauthorizedComponent },
{ path: 'lazy', loadChildren: './lazy/lazy.module#LazyModule' },
{
path: 'profile',
component: ProfileComponent,
canActivate: [AccessGuard],
data: {
accesses: ['Hello.View:Read', 'Hello.View:Update']
}
}
]),
BrowserModule,
HttpClientModule
],
bootstrap: [AppComponent]
declarations: [
AppComponent,
ProfileComponent,
MainComponent,
UnauthorizedComponent,
],
imports: [
AccessModule.forRoot({
accesses: {
UserForm: {
FirstName: {
Read: 'UserAccess',
},
Login: {
Read: 'Adminccess',
},
},
},
redirect: '/forbidden',
strategy: { provide: AccessStrategy, useClass: MyAccessStrategy },
}),
RouterModule.forRoot([
{ path: '', component: MainComponent },
{ path: 'forbidden', component: UnauthorizedComponent },
{
path: 'lazy',
loadChildren: () =>
import('./lazy/lazy.module').then((m) => m.LazyModule),
},
{
path: 'profile',
component: ProfileComponent,
canActivate: [AccessGuard],
data: {
accesses: ['Hello.View:Read', 'Hello.View:Update'],
},
},
]),
BrowserModule,
HttpClientModule,
],
bootstrap: [AppComponent],
})
export class AppModule { }
export class AppModule {}
10 changes: 2 additions & 8 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,7 @@
"compilerOptions": {
"baseUrl": "./",
"paths": {
"core": [
"dist/core/core",
"dist/core"
]
"ngx-access": ["projects/core/src/public-api"]
},
"outDir": "./dist/out-tsc",
"forceConsistentCasingInFileNames": true,
Expand All @@ -22,10 +19,7 @@
"importHelpers": true,
"target": "es2015",
"module": "es2020",
"lib": [
"es2018",
"dom"
]
"lib": ["es2018", "dom"]
},
"angularCompilerOptions": {
"enableI18nLegacyMessageIdFormat": false,
Expand Down

0 comments on commit c66111b

Please sign in to comment.