rez_core 6.5.3 → 6.5.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/settings.local.json +26 -0
- package/.idea/250218_nodejs_core.iml +9 -0
- package/.idea/codeStyles/Project.xml +59 -0
- package/.idea/codeStyles/codeStyleConfig.xml +5 -0
- package/.idea/copilot.data.migration.agent.xml +6 -0
- package/.idea/copilot.data.migration.ask.xml +6 -0
- package/.idea/copilot.data.migration.ask2agent.xml +6 -0
- package/.idea/copilot.data.migration.edit.xml +6 -0
- package/.idea/inspectionProfiles/Project_Default.xml +6 -0
- package/.idea/misc.xml +6 -0
- package/.idea/modules.xml +8 -0
- package/.idea/prettier.xml +6 -0
- package/.idea/vcs.xml +6 -0
- package/dist/module/enterprise/entity/organization-app-mapping.entity.d.ts +2 -0
- package/dist/module/enterprise/entity/organization-app-mapping.entity.js +8 -0
- package/dist/module/enterprise/entity/organization-app-mapping.entity.js.map +1 -1
- package/dist/module/user/service/role.service.d.ts +2 -0
- package/dist/module/user/service/role.service.js +9 -2
- package/dist/module/user/service/role.service.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/server.log +850 -0
- package/src/module/enterprise/entity/organization-app-mapping.entity.ts +6 -0
- package/src/module/user/service/role.service.ts +11 -2
|
@@ -8,10 +8,16 @@ export class OrganizationAppMapping {
|
|
|
8
8
|
@PrimaryGeneratedColumn({ name: 'id', type: 'int' })
|
|
9
9
|
id: number;
|
|
10
10
|
|
|
11
|
+
@Column({ type: 'int', nullable: true })
|
|
12
|
+
organization_id: number;
|
|
13
|
+
|
|
11
14
|
@ManyToOne(() => OrganizationData, { nullable: true, onDelete: 'SET NULL' })
|
|
12
15
|
@JoinColumn({ name: 'organization_id', referencedColumnName: 'id' })
|
|
13
16
|
organization: OrganizationData;
|
|
14
17
|
|
|
18
|
+
@Column({ type: 'int', nullable: true })
|
|
19
|
+
app_id: number;
|
|
20
|
+
|
|
15
21
|
@ManyToOne(() => AppMaster, { nullable: true, onDelete: 'SET NULL' })
|
|
16
22
|
@JoinColumn({ name: 'app_id', referencedColumnName: 'id' })
|
|
17
23
|
app: AppMaster;
|
|
@@ -8,6 +8,7 @@ import { InjectRepository } from '@nestjs/typeorm';
|
|
|
8
8
|
import { ModuleAccess } from '../../module/entity/module-access.entity';
|
|
9
9
|
import { UserRoleMapping } from '../entity/user-role-mapping.entity';
|
|
10
10
|
import { plainToInstance } from 'class-transformer';
|
|
11
|
+
import { StatusConstant } from '../../../constant/status.constant';
|
|
11
12
|
|
|
12
13
|
@Injectable()
|
|
13
14
|
export class RoleService {
|
|
@@ -52,7 +53,7 @@ export class RoleService {
|
|
|
52
53
|
if (role.copy_from_role_id && !sourceRole) {
|
|
53
54
|
return { success: false, error: 'Source role not found.' };
|
|
54
55
|
}
|
|
55
|
-
role.status =
|
|
56
|
+
role.status = StatusConstant.ACTIVE;
|
|
56
57
|
const savedRole = await this.roleRepository.saveRole(role);
|
|
57
58
|
if (sourceRole) {
|
|
58
59
|
const sourcePermissions = await this.moduleAccessRepo.find({
|
|
@@ -95,7 +96,7 @@ export class RoleService {
|
|
|
95
96
|
const associatedUsers = await this.userRoleMappingRepo
|
|
96
97
|
.createQueryBuilder('map')
|
|
97
98
|
.innerJoin('sso_user', 'usr', 'map.user_id = usr.id')
|
|
98
|
-
.where('usr.status::text = :status', { status:
|
|
99
|
+
.where('usr.status::text = :status', { status: StatusConstant.INACTIVE })
|
|
99
100
|
.andWhere('map.role_id::text = :roleId', {
|
|
100
101
|
roleId: String(existingRole?.id),
|
|
101
102
|
})
|
|
@@ -174,4 +175,12 @@ export class RoleService {
|
|
|
174
175
|
}): Promise<Role[] | null> {
|
|
175
176
|
return await this.roleRepository.find(data);
|
|
176
177
|
}
|
|
178
|
+
|
|
179
|
+
async findByCode(code: string) {
|
|
180
|
+
return await this.roleRepository.findByCode(code);
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
async findById(id: number) {
|
|
184
|
+
return await this.roleRepository.findById(id);
|
|
185
|
+
}
|
|
177
186
|
}
|