- 🇩🇪Germany jurgenhaas Gottmadingen
Have you tried the action to switch user context in your model? If you e.g. switch to user 1 right before the assign role action, all should be fine.
- Status changed to Fixed
over 1 year ago 9:10am 15 July 2023 Automatically closed - issue fixed for 2 weeks with no activity.
- Status changed to Fixed
2 months ago 6:14pm 2 January 2025 - 🇫🇷France alex.amtr
Hi @jurgenhaas,
The solution, you propose seems to me very dangerous.
If you give administrator role to the current user and there is a problem to restore the initial role, the current user become an administrator.
Am I right ? - 🇩🇪Germany jurgenhaas Gottmadingen
I'm not proposing to give the current user the admin role.
What I'm proposing is to switch the user context inside the ECA model to allow the model to execute actions with more permissions than the current user. You can read more about that concept at https://ecaguide.org/eca/concepts/permissions/
Note, if you write custom code instead, that code can always be executed without any limitations. The fact that ECA limits permissions by default is already a major improvement.
Note 2: This issue was closed 1,5 years ago. It's not a good idea to continue discussions in closed issues. If you have a follow-up question it's recommended to open a new issue and link back to an older one, if that's helpful to provide contextual information.