(()=>{function e(e,n,o,t){var r=/groups\/\d+$/,a="user/inventoryroles",u={"Content-Type":"application/json",Accept:"application/json"};function c(){return o.url(a)}function i(e){e=o.getId(e);return o.url("".concat(a,"/").concat(e))}function l(e){var t=i(e);return n.put(t,e,{headers:u})}function s(e){var t=c(),r={headers:u};return delete e.id,n.post(t,e,r)}return{list:function e(t){var t=o.pageSizeFilter(t),r={params:t},t=o.cleanListCallback("roles",e,t);return n.get(c(),r).then(t)},detail:function(e){return e=i(e),n.get(e)},remove:function(e){return e=i(e),n.delete(e,{silentError:!0})},create:s,update:l,save:function(e){return(e.id?l:s)(e)},global:t,isGlobal:function(e){var t=!1;return t=e&&e.self?r.test(e.self):t}}}e.$inject=["$q","$http","c8yBase","c8yUserGroup"],angular.module("c8y.core").factory("c8yRoles",e)})();