hi,

this module seems not to work in combination with domain access. If anyone could point me into the right direction I'm willing to sacrifice some time.

Comments

MegaChriz’s picture

I do not use the Domain access module, but the issue might be related to path access callbacks. Userprotect alters the access callbacks of the following paths in order to control edit/delete access on user accounts:

  • user/%user/edit
  • user/%user/cancel

See userprotect_menu_alter().
If the Domain access module also modifies these paths then there could be a module conflict. If this is the case, then the issue could be solved by using a "glue" module that also alters the access callbacks of these paths, but in the implementation makes sure that access checks for both modules are performed. Be sure to make the weight of this module higher so it gets the last word.

If, on the other hand, the Domain access module provides an alternative interface for modifying user accounts then the issue should probably also be solved by using a glue module that would hook into the Domain access process and performs access checks from the userprotect module. You would need to call the functions user_access(), userprotect_check_bypass() and userprotect_get_user_protection() for that. See for examples userprotect_form_user_profile_form_alter(), userprotect_user_edit_access() and userprotect_user_cancel_access().
In some rare cases the issue could be solved by adding integration code to userprotect, like is done for the modules Views Bulk Operations and RoleAssign. The requirements for integration code would be that it adds minimal complexity and an automated test to ensure the integration keeps working in the future.