Skip to content

Commit

Permalink
Update permission.ts
Browse files Browse the repository at this point in the history
temporary open for tester
  • Loading branch information
phatna03 authored Mar 19, 2024
1 parent 347941f commit ab7886f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/admin/src/utils/permission.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import { RoleEnum, User } from '@mlem-admin/types/user';

export const isAdmin = (user: User) => {
return user.roles && user.roles.includes(RoleEnum.ADMIN);
return (
(user.roles && user.roles.includes(RoleEnum.ADMIN)) ||
(user.roles && user.roles.includes(RoleEnum.USER))
);
};

0 comments on commit ab7886f

Please sign in to comment.