Skip to content

Commit

Permalink
Fix role logic
Browse files Browse the repository at this point in the history
  • Loading branch information
Excellify committed Jun 12, 2024
1 parent 6e7cbd7 commit c3c6864
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/composable/useSetMutation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,11 @@ export function useSetMutation(setID?: string): SetMutation {
});

const canEditIfLoggedIn = computed(() => {
console.log(actor.user?.roles);

Check warning on line 50 in src/composable/useSetMutation.ts

View workflow job for this annotation

GitHub Actions / WebExtension Lint, Build, Test

Unexpected console statement

Check warning on line 50 in src/composable/useSetMutation.ts

View workflow job for this annotation

GitHub Actions / WebExtension Lint, Build, Test

Unexpected console statement
if (!actor.user) return false;
if (ctx.id == actor.platformUserID) return true;
if (actor.user.roles?.some((r) => r in [SevenTVRoles.MODERATOR, SevenTVRoles.ADMIN])) return true;
if (actor.user.roles?.some((r) => [SevenTVRoles.MODERATOR, SevenTVRoles.ADMIN].includes(r as SevenTVRoles)))
return true;
return (ctx.user?.editors ?? []).some((e) => e.id == actor.user?.id);
});

Expand Down

0 comments on commit c3c6864

Please sign in to comment.