Skip to content

Fix: allow ROLE_ADMIN to POST /api/course_rel_users for other users#8672

Open
addow wants to merge 1 commit into
chamilo:masterfrom
webstone:fix/course-rel-user-admin-post
Open

Fix: allow ROLE_ADMIN to POST /api/course_rel_users for other users#8672
addow wants to merge 1 commit into
chamilo:masterfrom
webstone:fix/course-rel-user-admin-post

Conversation

@addow

@addow addow commented Jun 29, 2026

Copy link
Copy Markdown

Summary

  • securityPostDenormalize on the POST operation lacked an admin bypass: admins received 403 when subscribing any user other than themselves
  • The upstream security commit (2a9f060) enforces self-enrollment but omitted ROLE_ADMIN from the post-denormalize check
  • Mirrors the ROLE_ADMIN bypass already present in CourseRelUserStateProcessor

Test plan

  • POST /api/course_rel_users as ROLE_ADMIN with user = another user → HTTP 201
  • POST /api/course_rel_users as regular user with user = self → HTTP 201
  • POST /api/course_rel_users as regular user with user = other user → HTTP 403

…for other users

The upstream security commit (2a9f060) added securityPostDenormalize to
enforce self-enrollment, but omitted an admin bypass. Admins received 403
when subscribing any user other than themselves.

Mirrors the ROLE_ADMIN bypass already present in CourseRelUserStateProcessor.
@addow addow force-pushed the fix/course-rel-user-admin-post branch from aa36441 to 2cd1d3c Compare June 30, 2026 08:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant