Skip to content

Repository files navigation

ngRights

ngRights is a library that allows you to easily add feature-toggling, RBAC and ABAC policies to your front-end.

Demo using rawgit

You can find all the details in the wiki where you will find the wiki sections, how to quickstart, how to contribute and the project's timeline.

The Quickstart section is repeated here for simplicity:

Quickstart

1. Install the library

bower install ngRights

2. Define rights

app.config(['ngRightsProvider', function(ngRightsProvider) {
  ngRightsProvider.setRules({
    page: {
      post: {
        create: function(subject, page) { return page.ownerId == subject.id; }
      }
    }
  });
}]);

3. Use ngRights

<div ng-controller="PageController">
  <h1>{{ page.title }}</h1>
  <button ng-rights="pages.posts.create(page)">Create new post</button>
  <div ng-repeat="post in page.posts">
    {{ post.title }}
  </div>
</div>

About

ABAC policy rights library for AngularJS

Resources

Stars

5 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages