-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(stark-rbac): implement new Stark-RBAC package including StarkRBA…
…CAuthorization module. Add demos for RBAC features in Showcase ISSUES CLOSED: #105
- Loading branch information
1 parent
c5c34c6
commit 53d3f33
Showing
91 changed files
with
2,846 additions
and
213 deletions.
There are no files selected for viewing
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,4 @@ stark-build | |
stark-testing | ||
stark-core | ||
stark-ui | ||
stark-rbac |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"$schema": "../../node_modules/@compodoc/compodoc/src/config/schema.json", | ||
"theme": "material", | ||
"tsconfig": "../tsconfig.json", | ||
"output": "../../reports/api-docs/stark-rbac" | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
registry=https://registry.npmjs.org |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
[![NPM version](https://img.shields.io/npm/v/@nationalbankbelgium/stark-rbac.svg)](https://www.npmjs.com/package/@nationalbankbelgium/stark-rbac) | ||
[![npm](https://img.shields.io/npm/dm/@nationalbankbelgium/stark-rbac.svg)](https://www.npmjs.com/package/@nationalbankbelgium/stark-rbac) | ||
[![Build Status](https://travis-ci.org/NationalBankBelgium/stark.svg?branch=master)](https://travis-ci.org/NationalBankBelgium/stark) | ||
[![Dependency Status](https://david-dm.org/NationalBankBelgium/stark-rbac.svg)](https://david-dm.org/NationalBankBelgium/stark-rbac) | ||
[![devDependency Status](https://david-dm.org/NationalBankBelgium/stark-rbac/dev-status.svg)](https://david-dm.org/NationalBankBelgium/stark-rbac#info=devDependencies) | ||
[![License](https://img.shields.io/cocoapods/l/AFNetworking.svg)](LICENSE) | ||
|
||
# Stark RBAC | ||
|
||
Stark's RBAC module (aka stark-rbac) is a separate module in Stark that can be optionally included in any Stark based application in order to provide different elements | ||
(directives, services and components) to support Role Based Access Control (RBAC) mechanism. | ||
|
||
The Stark-RBAC module depends on some functionalities provided by the Stark-Core module such as services. However you can use this module without Stark-Core | ||
as long as you provide the same functionalities/services yourself. | ||
|
||
**[Getting Started](https://stark.nbb.be/api-docs/stark-rbac/latest/additional-documentation/getting-started.html)** |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
{ | ||
"$schema": "./node_modules/@angular/cli/lib/config/schema.json", | ||
"version": 1, | ||
"newProjectRoots": "projects", | ||
"projects": { | ||
"stark-rbac": { | ||
"root": "", | ||
"sourceRoot": "src", | ||
"projectType": "library", | ||
"architect": { | ||
"build": { | ||
"options": { | ||
"outputPath": "dist", | ||
"tsConfig": "tsconfig-build.json", | ||
"assets": [] | ||
} | ||
}, | ||
"test": { | ||
"options": { | ||
"main": "base.spec.ts", | ||
"outputPath": "dist", | ||
"tsConfig": "tsconfig.spec.json", | ||
"assets": [] | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"defaultProject": "stark-rbac" | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
"use strict"; | ||
|
||
import "core-js/es6"; | ||
import "core-js/es7/reflect"; | ||
import "core-js/es7/string"; | ||
import "core-js/stage/4"; | ||
|
||
// IE polyfills | ||
|
||
// See https://developer.mozilla.org/en-US/docs/Web/API/Element/matches#Polyfill | ||
if (!Element.prototype.matches) { | ||
// @ts-ignore | ||
Element.prototype.matches = Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector; | ||
} | ||
|
||
// See: https://developer.mozilla.org/en-US/docs/Web/API/NodeList/forEach#Polyfill | ||
// @ts-ignore: Window.NodeList | ||
if (window.NodeList && !NodeList.prototype.forEach) { | ||
// @ts-ignore: forEach mismatching types | ||
NodeList.prototype.forEach = Array.prototype.forEach; | ||
} | ||
|
||
/* tslint:disable:no-import-side-effect */ | ||
import "zone.js/dist/zone"; | ||
import "zone.js/dist/long-stack-trace-zone"; | ||
import "zone.js/dist/proxy"; // since zone.js 0.6.15 | ||
import "zone.js/dist/sync-test"; | ||
import "zone.js/dist/jasmine-patch"; // put here since zone.js 0.6.14 | ||
import "zone.js/dist/async-test"; | ||
import "zone.js/dist/fake-async-test"; | ||
import "zone.js/dist/zone-patch-rxjs"; | ||
import "zone.js/dist/zone-patch-rxjs-fake-async"; | ||
/* tslint:enable:no-import-side-effect */ | ||
|
||
import { TestBed } from "@angular/core/testing"; | ||
import { BrowserDynamicTestingModule, platformBrowserDynamicTesting } from "@angular/platform-browser-dynamic/testing"; | ||
|
||
TestBed.initTestEnvironment(BrowserDynamicTestingModule, platformBrowserDynamicTesting()); | ||
|
||
// define global environment variable (used in some places in stark-ui) | ||
global["ENV"] = "development"; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
// This file is not used to build this module. It is only used during editing | ||
// by the TypeScript language service and during build for verification. `ngc` | ||
// replaces this file with production index.ts when it rewrites private symbol | ||
// names. | ||
|
||
export * from "./public_api"; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
const helpers = require("../stark-testing/helpers"); | ||
|
||
/** | ||
* Load karma config from Stark | ||
*/ | ||
const defaultKarmaCIConfig = require("../stark-testing/karma.conf.ci.js").rawKarmaConfig; | ||
const karmaTypescriptBundlerAliasResolution = require("./karma.conf").karmaTypescriptBundlerAliasResolution; | ||
const karmaTypescriptFiles = require("./karma.conf").karmaTypescriptFiles; | ||
|
||
// start customizing the KarmaCI configuration from stark-testing | ||
const starkRBACSpecificConfiguration = { | ||
...defaultKarmaCIConfig, | ||
// change the module resolution for the KarmaTypescript bundler | ||
karmaTypescriptConfig: { | ||
...defaultKarmaCIConfig.karmaTypescriptConfig, | ||
bundlerOptions: { | ||
...defaultKarmaCIConfig.karmaTypescriptConfig.bundlerOptions, | ||
...karmaTypescriptBundlerAliasResolution, | ||
transforms: [ | ||
require("../stark-testing/node_modules/karma-typescript-angular2-transform"), | ||
require("../stark-testing/node_modules/karma-typescript-es6-transform")({ | ||
presets: [helpers.root("../stark-testing/node_modules/babel-preset-env")] // add preset in a way that the package can find it | ||
}) | ||
] | ||
} | ||
}, | ||
// change the path of the report so that Coveralls takes the right path to the source files | ||
coverageIstanbulReporter: { ...defaultKarmaCIConfig.coverageIstanbulReporter, dir: helpers.root("reports/coverage/packages") }, | ||
// add missing files due to "@nationalbankbelgium/stark-rbac" imports used in mock files of the testing sub-package | ||
files: [...defaultKarmaCIConfig.files, ...karmaTypescriptFiles] | ||
}; | ||
|
||
// export the configuration function that karma expects and simply return the stark configuration | ||
module.exports = config => { | ||
return config.set(starkRBACSpecificConfiguration); | ||
}; |
Oops, something went wrong.