ngRights is a library that allows you to easily add feature-toggling, RBAC and ABAC policies to your front-end.
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:
bower install ngRights
app.config(['ngRightsProvider', function(ngRightsProvider) {
ngRightsProvider.setRules({
page: {
post: {
create: function(subject, page) { return page.ownerId == subject.id; }
}
}
});
}]);<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>