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.
-
can_create_group
condition - app/policies/base_policy.rb#L58 -
can_create_group
method - app/models/user.rb#L68
Implementation guide
- New database column in
application_settings
-can_create_organization
, defaulttrue
,not null
- Update the policy above
Mockup:
Not in scope
We decided to not implement individual user based can_create_organization
New database column inusers
-can_create_organization
, defaulttrue
,not null
Similar code tocan_create_group
in various places (Seegit grep can_create_group
)
Edited by Thong Kuah