@solidstarters/solid-core 1.2.172 → 1.2.173

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@solidstarters/solid-core",
3
- "version": "1.2.172",
3
+ "version": "1.2.173",
4
4
  "description": "This module is a NestJS module containing all the required core providers required by a Solid application",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -31,6 +31,8 @@ export class UserService extends CRUDService<User> {
31
31
  readonly entityManager: EntityManager,
32
32
  // @InjectRepository(User, 'default')
33
33
  readonly repo: UserRepository,
34
+ @InjectRepository(User, 'default')
35
+ readonly nonSecurityRuleAwareRepo : Repository<User>,
34
36
  @InjectRepository(RoleMetadata)
35
37
  private readonly roleRepository: Repository<RoleMetadata>,
36
38
  readonly moduleRef: ModuleRef,
@@ -141,7 +143,7 @@ export class UserService extends CRUDService<User> {
141
143
  }
142
144
 
143
145
  async addRolesToUser(username: string, roleNames: string[]): Promise<User> {
144
- const user = await this.repo.findOne({
146
+ const user = await this.nonSecurityRuleAwareRepo.findOne({
145
147
  where: { username: username },
146
148
  relations: { roles: true }
147
149
  });
@@ -174,7 +176,7 @@ export class UserService extends CRUDService<User> {
174
176
  user.roles = user.roles.filter(role => !rolesToRemove.includes(role));
175
177
  }
176
178
 
177
- return await this.repo.save(user);
179
+ return await this.nonSecurityRuleAwareRepo.save(user);
178
180
  }
179
181
 
180
182