!function(e){function i(n){if(t[n])return t[n].exports;var s=t[n]={exports:{},id:n,loaded:!1};return e[n].call(s.exports,s,s.exports,i),s.loaded=!0,s.exports}var t={};return i.m=e,i.c=t,i.p="",i(0)}([function(e,i,t){Vue.ready(_.merge(t(1),{el:"#permissions"}))},function(e,i){e.exports={data:function(){return window.$data},created:function(){this.Roles=this.$resource("api/user/role{/id}"),this.debounced=[],this.saveCb=Vue.util.debounce(function(){this.Roles.save({id:"bulk"},{roles:this.debounced}).then(function(){this.$notify("Permissions saved")}),this.debounced=[]}.bind(this),1e3)},computed:{authenticated:function(){return this.roles.filter(function(e){return e.authenticated})[0]}},methods:{savePermissions:function(e){_.find(this.debounced,"id",e.id)||this.debounced.push(e),this.saveCb()},addPermission:function(e,i){return e.administrator?null:e.permissions.push(i)},hasPermission:function(e,i){return-1!==e.permissions.indexOf(i)},isInherited:function(e,i){return!e.locked&&this.hasPermission(this.authenticated,i)},showFakeCheckbox:function(e,i){return e.administrator||this.isInherited(e,i)&&!this.hasPermission(e,i)}}}}]);