sf-reaccess
AngularJS tools to customize users interfaces based on their rights on the REST API.
See those slides to know more about the
reaccess
project principles.
Quick start
Consider the following template:
Add a user {{ user.name }} Edit this user Delete this user
It will display add/edit/delete buttons depending on the user rights comparing to the methods and pathes set for the given predefined rights.
Predefined rights are set in your application configuration like this:
angular ;
User rights are set by using the sfReaccessService.setRights()
method,
they look like this:
sfReaccessService;
Path values are templated regular expressions. To set objects where to search
for template expressions values, use sfReaccessService.setValues()
:
sfReaccessService;
Debugging
You can enable sfReaccess debug mode globally:
angular ;
Or locally as an argument to the angular filter:
Add a user
Contribute
To contribute to this project, first run the following to setup the development environment:
npm installbower install
Then, run the tests and debug with Karma:
npm run dev
Note for Express users
If you use Express for your backend, you may be interested by the
express-reaccess
middleware.