Skip to content

Instantly share code, notes, and snippets.

Application.Common.directive('ifRole', ["AuthService", function(AuthService) {
return {
restrict: "A",
transclude: "element",
scope: {},
compile: function(el, attrs, transclude) {
var currentUserRole = AuthService.currentUser.role;
var specifiedRole = attrs.ifRole;
return function(scope, el, attrs) {