diff --git a/back/methods/account/getRoles.js b/back/methods/account/getRoles.js deleted file mode 100644 index 2a4e50ef2..000000000 --- a/back/methods/account/getRoles.js +++ /dev/null @@ -1,31 +0,0 @@ -module.exports = Self => { - Self.remoteMethodCtx('getUserRoles', { - description: 'Gets the user roles', - accepts: - { - arg: 'ctx', - type: 'Object', - http: {source: 'context'} - }, - returns: { - type: 'object', - root: true - }, - http: { - path: `/getUserRoles`, - verb: 'POST' - } - }); - - Self.getUserRoles = async ctx => { - // Get the user from the accesstoken - const userId = ctx.req.accessToken.userId; - - // Get the user roles - const roles = await Self.getRoles(userId, { - ctx: ctx - }); - - return roles; - }; -}; diff --git a/back/models/account.js b/back/models/account.js index 902e1e067..c2502380a 100644 --- a/back/models/account.js +++ b/back/models/account.js @@ -12,7 +12,6 @@ module.exports = Self => { require('../methods/account/recover-password')(Self); require('../methods/account/validate-token')(Self); require('../methods/account/privileges')(Self); - require('../methods/account/getRoles')(Self); // Validations diff --git a/front/core/services/acl-service.js b/front/core/services/acl-service.js index ee4404d34..dbba23884 100644 --- a/front/core/services/acl-service.js +++ b/front/core/services/acl-service.js @@ -14,7 +14,6 @@ class AclService { return this.$http.get('Accounts/acl').then(res => { this.user = res.data.user; this.roles = {}; - for (let role of res.data.roles) { if (role.role) this.roles[role.role.name] = true; diff --git a/front/core/services/user-acl-service.js b/front/core/services/user-acl-service.js new file mode 100644 index 000000000..0d20c78b0 --- /dev/null +++ b/front/core/services/user-acl-service.js @@ -0,0 +1,15 @@ +import ngModule from '../module'; + +class UserAclService { + constructor($http) { + this.$http = $http; + this.roles = []; + } + + load() { + + } +} +UserAclService.$inject = ['$http']; + +ngModule.service('userAclService', UserAclService);