Skip to content

Update `create_organization` condition to check application setting

Follow-up to !126225 (comment 1509231817)

In app/policies/base_policy.rb#L62 we temporarily set the can_create_organization condition to true so it can be used to setup routes. We should update this condition to check an application setting similar to what the can_create_group does.

Implementation guide

  • New database column in application_settings - can_create_organization, default true, not null
  • Update the policy above

Mockup:

Screenshot_2023-09-25_at_4.57.54_PM

Not in scope

We decided to not implement individual user based can_create_organization

  • New database column in users - can_create_organization, default true, not null
  • Similar code to can_create_group in various places (See git grep can_create_group)
Edited by Thong Kuah