@c8y/ng1-modules 1022.4.14 → 1022.4.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -208,6 +208,8 @@
|
|
|
208
208
|
<div
|
|
209
209
|
class="p-r-8 text-right showOnHover col-1"
|
|
210
210
|
ng-if="isEditable(rule)"
|
|
211
|
+
c8y-if-allowed
|
|
212
|
+
any-role="['ROLE_RETENTION_RULE_ADMIN']"
|
|
211
213
|
>
|
|
212
214
|
<button
|
|
213
215
|
class="btn btn-dot btn-dot--danger hidden-xs"
|
|
@@ -228,6 +230,8 @@
|
|
|
228
230
|
title="{{ 'Delete' | translate }}"
|
|
229
231
|
type="button"
|
|
230
232
|
data-ng-click="removeWithConfirmation(rule);$event.stopPropagation()"
|
|
233
|
+
c8y-if-allowed
|
|
234
|
+
any-role="['ROLE_RETENTION_RULE_ADMIN']"
|
|
231
235
|
>
|
|
232
236
|
<i c8y-icon="delete"></i>
|
|
233
237
|
{{ 'Delete' | translate }}
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{function e(){return{restrict:"EA",scope:{user:"=",allSelected:"=?",allowedApplications:"=",disabledEdit:"=?"},templateUrl:":::PLUGIN_PATH:::/applicationAccess/applicationAccess.html",controller:i}}function i(l,e,i){function t(e){return _.uniqBy(e,"id")}function n(e){l.applications=_.filter(e,{
|
|
1
|
+
(()=>{function e(){return{restrict:"EA",scope:{user:"=",allSelected:"=?",allowedApplications:"=",disabledEdit:"=?"},templateUrl:":::PLUGIN_PATH:::/applicationAccess/applicationAccess.html",controller:i}}function i(l,e,i){function t(e){return _.uniqBy(e,"id")}function n(e){l.applications=_.filter(e,function(e){return"MICROSERVICE"!==e.type}),l.marketApps=_.filter(l.applications,{availability:"MARKET"}),l.privateApps=_.filter(l.applications,{availability:"PRIVATE"})}function a(e){return l.allSelected||_.some(l.allowedApplications,c(e))||r(e)}function c(i){return function(e){return _.toNumber(i.id)===_.toNumber(e.id)}}function r(e){var i,e=e.id,t=l.user;return t&&!l.allSelected&&(t=_(_.get(t,"groups.references")).map("group").map("applications").flatten().uniqBy("id").map("id").value(),i=_.includes(t,e)),i}function o(e){var i=_.get(l,"user._owner.applications");return i&&!r(e)&&!_.some(i,{id:e.id})}l.isAccessAllowed=a,l.toggleAccess=function(e){(a(e)?e=>{l.allowedApplications=_.reject(l.allowedApplications,c(e))}:e=>{l.allowedApplications=l.allowedApplications||[],l.allowedApplications.push({id:e.id,type:e.type})})(e)},l.alreadyInGlobalRole=r,l.isDisabled=function(e){return l.allSelected||l.disabledEdit||r(e)||o(e)},l.notAvailableInOwner=o,l.noOwnerAvailable=function(){return _.get(l,"user")&&!_.get(l,"user._owner")},e.current().then(i.listByUser).then(t).then(n)}i.$inject=["$scope","c8yUser","c8yApplication"],angular.module("c8y.users").directive("c8yApplicationAccess",e).directive("applicationAccessEditor",e)})();
|