(data: Partial<Item>, opts: MutationOptions = {})
| 17 | } |
| 18 | |
| 19 | override async createOne(data: Partial<Item>, opts: MutationOptions = {}): Promise<PrimaryKey> { |
| 20 | // Creating a new policy attachments affects the number of admin/app/api users. |
| 21 | // But it can only add app or admin users, so no need to check the remaining admin users. |
| 22 | opts.userIntegrityCheckFlags = |
| 23 | (opts.userIntegrityCheckFlags ?? UserIntegrityCheckFlag.None) | UserIntegrityCheckFlag.UserLimits; |
| 24 | |
| 25 | opts.onRequireUserIntegrityCheck?.(opts.userIntegrityCheckFlags); |
| 26 | |
| 27 | const result = await super.createOne(data, opts); |
| 28 | |
| 29 | // A new policy has been attached to a user or a role, clear the caches |
| 30 | await this.clearCaches(); |
| 31 | |
| 32 | return result; |
| 33 | } |
| 34 | |
| 35 | override async updateMany( |
| 36 | keys: PrimaryKey[], |
no test coverage detected