Skip to content

Commit

Permalink
Avoid returning on admin
Browse files Browse the repository at this point in the history
  • Loading branch information
minottic committed Dec 12, 2024
1 parent c84b878 commit c935c45
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions sci-log-db/src/repositories/autoadd.repository.base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -342,17 +342,16 @@ export class AutoAddRepository<
'[email protected]';
await this.aclDefaultOnCreation(ctx.instance);
if (
currentUser.roles.some(
!currentUser.roles.some(
(role: string) =>
role === 'admin' || ctx.instance.adminACL?.includes(role),
)
)
return;
ctx.instance.createdAt = new Date();
ctx.instance.createdBy = currentUser?.email ?? '[email protected]';
ctx.instance.updatedAt = new Date();
ctx.instance.updatedBy = currentUser?.email ?? '[email protected]';

) {
ctx.instance.createdAt = new Date();
ctx.instance.createdBy = currentUser?.email ?? '[email protected]';
ctx.instance.updatedAt = new Date();
ctx.instance.updatedBy = currentUser?.email ?? '[email protected]';
}
if (typeof ctx.instance.expiresAt == 'undefined') {
// default expiration time is 3 days
ctx.instance.expiresAt = new Date();
Expand Down

0 comments on commit c935c45

Please sign in to comment.