2018-02-14 09:06:51 +00:00
|
|
|
import ngModule from '../module';
|
|
|
|
|
|
|
|
function vnVisibleBy(aclService) {
|
|
|
|
return {
|
|
|
|
restrict: 'A',
|
|
|
|
priority: -1,
|
|
|
|
link: function($scope, $element, $attrs) {
|
2019-02-01 12:52:26 +00:00
|
|
|
let acls = $attrs.vnVisibleBy.replace(/\s/g, '');
|
|
|
|
acls = acls.split(',');
|
|
|
|
|
2019-01-23 12:11:44 +00:00
|
|
|
if (!aclService.hasAny(acls))
|
2018-02-14 09:06:51 +00:00
|
|
|
$element[0].style.visibility = 'hidden';
|
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|
|
|
|
vnVisibleBy.$inject = ['aclService'];
|
|
|
|
|
|
|
|
ngModule.directive('vnVisibleBy', vnVisibleBy);
|