#5666 - Loggable to mixin #1826

Merged
alexm merged 29 commits from 5666-loggable_to_mixin into dev 2024-01-04 09:21:57 +00:00
5 changed files with 6 additions and 6 deletions
Showing only changes of commit 57add7abf0 - Show all commits

View File

@ -68,7 +68,7 @@ module.exports = Self => {
userToUpdate.hasGrant = hasGrant;
if (roleFk) {
const role = await models.Role.findById(roleFk, {fields: ['name']}, myOptions);
const role = await models.VnRole.findById(roleFk, {fields: ['name']}, myOptions);
const hasRole = await Self.hasRole(userId, role.name, myOptions);
if (!hasRole)

View File

@ -70,7 +70,7 @@ describe('VnUser privileges()', () => {
const tx = await models.VnUser.beginTransaction({});
const options = {transaction: tx};
const agency = await models.Role.findOne({
const agency = await models.VnRole.findOne({
where: {
name: 'agency'
}

View File

@ -239,7 +239,7 @@ module.exports = Self => {
// Prepare data
let roles = await $.Role.find({
let roles = await $.VnRole.find({
fields: ['id', 'name', 'description']
});
let roleRoles = await $.RoleRole.find({

View File

@ -102,7 +102,7 @@ describe('sale canEdit()', () => {
try {
const options = {transaction: tx};
const role = await models.Role.findOne({
const role = await models.VnRole.findOne({
where: {
name: roleEnabled.principalId
}
@ -159,7 +159,7 @@ describe('sale canEdit()', () => {
try {
const options = {transaction: tx};
const role = await models.Role.findOne({
const role = await models.VnRole.findOne({
where: {
name: roleEnabled.principalId
}

View File

@ -3,7 +3,7 @@ const app = require('vn-loopback/server/server');
describe('Worker activeWithInheritedRole', () => {
let allRolesCount;
beforeAll(async() => {
allRolesCount = await app.models.Role.count();
allRolesCount = await app.models.VnRole.count();
});
it('should return the workers with an inherited role of salesPerson', async() => {