User must be able to read Current.organization

Gitlab::Current::Organization should ensure that when a User is provided, the Organization is always one of the User's organization memberships.

Exceptions:

  • Admin
  • Public Organizations

We achieve this using something like can?(:read, organization) from within Gitlab::Current::Organization.

If the User can't access the organization Current.organization should return nil.

Edited by Rutger Wessels