Skip to content

Follow-up from "Withdraw abilities when organization does not match current organization"

The following discussions from !196700 (merged) should be addressed:

  • @dlrussel started a discussion: (+4 comments)

    Do we care about admin mode here? The admin condition accounts for admin mode and this does not.

More context: the BasePolicy condition in_current_organization should be true if the user accessing the subject is an Instance admin.

This check is now implemented using user.admin? check. We could also involve the condition condition(:admin) but this one is using Admin mode. An unknown number of specs will break if we start to rely on Admin mode.

  • @dlrussel started a discussion: (+4 comments)

    I see that the intended behavior but I'm unclear on why we are making an exception when the subject is an Organization.

Suggestion is to use \@subject.is_a? Organizations::Organization && can(:read_organization, \@user) as additional condition. Let validate if that makes sense.

Edited by Rutger Wessels