rez_core 1.0.55 → 1.0.56
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/package.json
CHANGED
|
@@ -175,6 +175,14 @@ export class ModuleAccessRepository {
|
|
|
175
175
|
if (nameExists) {
|
|
176
176
|
throw new BadRequestException('Role name already exists.');
|
|
177
177
|
}
|
|
178
|
+
if(copyFromRoleId){
|
|
179
|
+
const sourceRole = await this.roleRepo.findOne({
|
|
180
|
+
where: { id: copyFromRoleId },
|
|
181
|
+
});
|
|
182
|
+
if (!sourceRole) {
|
|
183
|
+
throw new BadRequestException('Source role not found');
|
|
184
|
+
}
|
|
185
|
+
}
|
|
178
186
|
|
|
179
187
|
// 1. Create the role without the code (code will be updated after ID is generated)
|
|
180
188
|
const newRole = this.roleRepo.create({
|