(()=>{function n(n,e,t,o){var r=this,i={header:o("Grant permissions on a general level."),text:o("There are several default roles defined, but you can define your own according to your needs.")},o={header:o("Manage user permissions on a particular group and/or its children."),text:o("There are several default inventory roles defined, but you can define your own according to your needs.")};function l(){return n.all([a(),c()])}function a(){return e.global.list().then(function(n){return u("global",n)})}function u(n,e){var t=(t=r["".concat(n,"Roles")])||[];e.forEach(function(n){t.push(n)}),t.paging=e.paging,r["".concat(n,"Roles")]=t}function c(){return e.list().then(function(n){return u("inventory",n)})}_.assign(r,{onRemove:function(e,n){_.remove(n,function(n){return n.id===e.id})},listGlobal:a,listInventory:c,listAll:l,loadNext:function(e){var n=r["".concat(e,"Roles")];n.paging.loading=!0,n.paging.next().then(function(n){return u(e,n)}).finally(function(){n.paging.loading=!1})},add:t.add,globalHelpText:i,inventoryHelpText:o}),t.setListTitle(),l()}n.$inject=["$q","c8yRoles","c8yRolesUi","gettext"],angular.module("c8y.roles").controller("c8yRolesOverviewCtrl",n)})();