
Security News
Feross on the 10 Minutes or Less Podcast: Nobody Reads the Code
Socket CEO Feross Aboukhadijeh joins 10 Minutes or Less, a podcast by Ali Rohde, to discuss the recent surge in open source supply chain attacks.
ngpermission
Advanced tools
Add authorization to angular route, so restriction route to specific tole becomes so easy.
Add authorization to angular route, so restriction route to specific tole becomes so easy.
Install via bower:
bower install ngPermission
Install via npm:
npm install ngpermission
Add dependency to you module:
angular.module("your app name",["ngPermission"])
Add role permission to route:
.when('/view1', {
templateUrl: 'view1/view1.html',
controller: 'View1Ctrl',
authorizedRole: ['admin']
})
Resolve if role is present:
.run(['$rootScope', '$http', '$route', function ($rootScope, $http, $route) {
$rootScope.$on('ngPermission', function (event,roles, defer,routeObject) {
// do what you want to do
//role ["admin"]
//routeObject {templateUrl: 'view1/view1.html',controller: 'View1Ctrl',authorizedRole: ['admin']}
$http.get('/someUrl').success(function(data){
var indexRole = roles.indexOf(data.role);
if(indexRole!=-1){
defer.resolve();
}
});
});
}])
FAQs
Add authorization to angular route, so restriction route to specific tole becomes so easy.
We found that ngpermission demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Socket CEO Feross Aboukhadijeh joins 10 Minutes or Less, a podcast by Ali Rohde, to discuss the recent surge in open source supply chain attacks.

Research
/Security News
Campaign of 108 extensions harvests identities, steals sessions, and adds backdoors to browsers, all tied to the same C2 infrastructure.

Security News
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.