Skip to content

Commit c935c45

Browse files
committed
Avoid returning on admin
1 parent c84b878 commit c935c45

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

sci-log-db/src/repositories/autoadd.repository.base.ts

+7-8
Original file line numberDiff line numberDiff line change
@@ -342,17 +342,16 @@ export class AutoAddRepository<
342342
343343
await this.aclDefaultOnCreation(ctx.instance);
344344
if (
345-
currentUser.roles.some(
345+
!currentUser.roles.some(
346346
(role: string) =>
347347
role === 'admin' || ctx.instance.adminACL?.includes(role),
348348
)
349-
)
350-
return;
351-
ctx.instance.createdAt = new Date();
352-
ctx.instance.createdBy = currentUser?.email ?? '[email protected]';
353-
ctx.instance.updatedAt = new Date();
354-
ctx.instance.updatedBy = currentUser?.email ?? '[email protected]';
355-
349+
) {
350+
ctx.instance.createdAt = new Date();
351+
ctx.instance.createdBy = currentUser?.email ?? '[email protected]';
352+
ctx.instance.updatedAt = new Date();
353+
ctx.instance.updatedBy = currentUser?.email ?? '[email protected]';
354+
}
356355
if (typeof ctx.instance.expiresAt == 'undefined') {
357356
// default expiration time is 3 days
358357
ctx.instance.expiresAt = new Date();

0 commit comments

Comments
 (0)