Skip to content

view: prioritize Moodle capabilities over assumed access of hosts#703

Merged
smbader merged 1 commit intoncstate-delta:fix/switch_rolesfrom
jrchamp:fix/switch_roles_prioritize_capabilities
Feb 26, 2026
Merged

view: prioritize Moodle capabilities over assumed access of hosts#703
smbader merged 1 commit intoncstate-delta:fix/switch_rolesfrom
jrchamp:fix/switch_roles_prioritize_capabilities

Conversation

@jrchamp
Copy link
Copy Markdown
Collaborator

@jrchamp jrchamp commented Feb 26, 2026

I didn't know how to communicate my ideas clearly in #697. This pull request builds on that pull request, prioritizing Moodle capabilities over access assumptions for hosts and Zoom activity managers.

In summary:

  • We don't need to check for a role switch, because the user is still the user.
  • Meeting capacity warnings should be shown to all users who can edit the activity.
  • If the user is a host (real or alternative), then they are already registered for the activity. A role switch does not and should not change their view of that.
  • (optional) The "Start Meeting" message is too confusing. Hosts and non-hosts are both going to join the meeting. If join before host is enable, then the hosts aren't technically starting the meeting anyway, so simplify the logic and reduce the confusion.
  • As we already have dedicated capabilities for viewjoinurl and viewdialin, it is wrong for us to override the Moodle administrator's choice of whether or not the user (based on their role) should have access to view that information. The Moodle administrator can decide whether viewjoinurl and viewdialin are granted to roles that can edit Zoom activities or not and we should respect/reflect that choice.

Net effect for complicated host variables:

  • $userishost is now only used to determine if the user is pre-registered
  • $userisrealhost does not emit PHP Notice when role switched

@jrchamp jrchamp requested a review from cbounphengsy February 26, 2026 15:14
@jrchamp jrchamp self-assigned this Feb 26, 2026
@jrchamp jrchamp added the bug Fixes problems or reduces technical debt label Feb 26, 2026
@smbader
Copy link
Copy Markdown
Contributor

smbader commented Feb 26, 2026

I really love the cleanup and move to a capability controlled logic as it should be within Moodle. Making this change inadvertently fixes the role switch problem now that we treat the viewing role as configured.

@smbader smbader merged commit f03e876 into ncstate-delta:fix/switch_roles Feb 26, 2026
7 checks passed
@jrchamp jrchamp deleted the fix/switch_roles_prioritize_capabilities branch February 26, 2026 16:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Fixes problems or reduces technical debt

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

2 participants