-
-
Notifications
You must be signed in to change notification settings - Fork 213
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Admin impersonation of user broken when permission check fixed #5064
Comments
This comment was marked as duplicate.
This comment was marked as duplicate.
@Deltik I have committed a draft fix, but it messes up some tests. In order for the changes to work the CLI mode needs to add values to the user-model object. Anyway, to test user impersonation with the new code, just add |
The modified method signature of To remedy this, I suggest that we extract I have another concern, which is the extra logic for plugins. I would move this into a new method called |
Along with extensive documentation, `getperms()` is now deprecated and its replacements now have first-class support: * `e_user_model::checkAdminPerms()` and `getperms()` both use `e_userperms::simulateHasAdminPerms()`. * `e_user_model::checkPluginAdminPerms()` and `getperms('P', …, …)` both use `e_userperms::simulateHasPluginAdminPerms()`. ---- Partially reverts: e107inc@44526b43 Reverts: e107inc@001799cb Fixes: e107inc#5064
Along with extensive documentation, `getperms()` is now deprecated and its replacements now have first-class support: * `e_user_model::checkAdminPerms()` and `getperms()` both use `e_userperms::simulateHasAdminPerms()`. * `e_user_model::checkPluginAdminPerms()` and `getperms('P', …, …)` both use `e_userperms::simulateHasPluginAdminPerms()`. ---- Partially reverts: e107inc@44526b43 Reverts: e107inc@001799cb Fixes: e107inc#5064
Along with extensive documentation, `getperms()` is now deprecated and its replacements now have first-class support: * `e_user_model::checkAdminPerms()` and `getperms()` both use `e_userperms::simulateHasAdminPerms()`. * `e_user_model::checkPluginAdminPerms()` and `getperms('P', …, …)` both use `e_userperms::simulateHasPluginAdminPerms()`. ---- Partially reverts: e107inc@44526b43 Reverts: e107inc@001799cb Fixes: e107inc#5064
Along with extensive documentation, `getperms()` is now deprecated and its replacements now have first-class support: * `e_user_model::checkAdminPerms()` and `getperms()` both use `e_userperms::simulateHasAdminPerms()`. * `e_user_model::checkPluginAdminPerms()` and `getperms('P', …, …)` both use `e_userperms::simulateHasPluginAdminPerms()`. ---- Partially reverts: e107inc@44526b43 Reverts: e107inc@001799cb Fixes: e107inc#5064
Along with extensive documentation, `getperms()` is now deprecated and its replacements now have first-class support: * `e_user_model::checkAdminPerms()` and `getperms()` both use `e_userperms::simulateHasAdminPerms()`. * `e_user_model::checkPluginAdminPerms()` and `getperms('P', …, …)` both use `e_userperms::simulateHasPluginAdminPerms()`. ---- Partially reverts: e107inc@44526b43 Reverts: e107inc@001799cb Fixes: e107inc#5064
Along with extensive documentation, `getperms()` is now deprecated and its replacements now have first-class support: * `e_user_model::checkAdminPerms()` and `getperms()` both use `e_userperms::simulateHasAdminPerms()`. * `e_user_model::checkPluginAdminPerms()` and `getperms('P', …, …)` both use `e_userperms::simulateHasPluginAdminPerms()`. ---- Partially reverts: e107inc@44526b43 Reverts: e107inc@001799cb Fixes: e107inc#5064
Along with extensive documentation, `getperms()` is now deprecated and its replacements now have first-class support: * `e_user_model::checkAdminPerms()` and `getperms()` both use `e_userperms::simulateHasAdminPerms()`. * `e_user_model::checkPluginAdminPerms()` and `getperms('P', …, …)` both use `e_userperms::simulateHasPluginAdminPerms()`. ---- Partially reverts: e107inc@44526b43 Reverts: e107inc@001799cb Fixes: e107inc#5064
Fixes: #5064 Unify logic of `e_user_model::checkAdminPerms()` and `getperms()`
Bug Description
fbcef7a fixed
getperms()
incorrectly identifying an unsetADMIN
constant as the literal string"ADMIN"
, but this had the unintended side effect of preventing ae_user::loadAs()
(impersonation) at this stack (using revision 5ff319c):The
ADMIN
constant would not be set until later ininit_session()
:How to Reproduce
As the main admin:
/e107_admin/users.php?mode=main&action=list
Expected Behavior
I'm not confident on the best way to solve this, but it is clear to me that we can't use
getperms()
until theADMIN
has been determined.We know from a note left by @myovchev in
e_user_model::checkAdminPerms()
that it was intended not to usegetperms()
. The fix for this issue probably involves rewritinggetperms()
ine_user_model::checkAdminPerms()
.The text was updated successfully, but these errors were encountered: