UNPKG

ndut-role

Version:

Role & Permission for Ndut Framework

6 lines (5 loc) 285 B
module.exports = async function (userId) { const teamUser = await this.ndutDb.model.RoleTeamUser.findOne({ where: { userId } }) if (!teamUser) throw this.Boom.forbidden('User doesn\'t belongs to any team yet') return await this.ndutRole.helper.getAccessByTeam(teamUser.teamId) }