Skip to content

Commit

Permalink
Add manager rule for achievements
Browse files Browse the repository at this point in the history
  • Loading branch information
neketka committed Apr 30, 2024
1 parent dc21d2c commit dbd0f40
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions server/src/casl/casl-ability.factory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,10 @@ export class CaslAbilityFactory {

can(Action.Read, 'AchievementTracker', { userId: user.id });

can(Action.Manage, 'Achievement', {
organizations: { some: { managers: { some: { id: user.id } } } },
});

// Read challenges that belong to events you're allowed to access
// And you must have completed them or are in the process
can(Action.Read, 'Challenge', undefined, {
Expand Down

0 comments on commit dbd0f40

Please sign in to comment.