CanEditActivity
Function: canEditActivity()
[object Object]
Defined in: util/group.util.ts:98
Determines if the current user has permission to edit a specific activity.
Logic mirrors the backend's PatchActivity/UpdateActivity authorization (see ActivityService.cs) exactly, so the edit button never appears for a request the backend would reject:
- Board Members: Always allowed to edit.
- Organizers: Allowed only if the activity hasn't ended, hasn't been finalized for external systems (Website/Koala), doesn't have an enrollment open date set or enrollment already opened, and belongs to their organizing group.
Parameters
activity
The activity data to check against.
tokenParsed
The parsed token containing user roles and ID.
Returns
[object Object]
True if the user is authorized to edit.