mirror of
https://github.com/astuto/astuto.git
synced 2025-12-15 19:27:52 +01:00
21 lines
360 B
Ruby
21 lines
360 B
Ruby
class TenantPolicy < ApplicationPolicy
|
|
def permitted_attributes_for_create
|
|
[:site_name, :subdomain]
|
|
end
|
|
|
|
def permitted_attributes_for_update
|
|
if user.admin?
|
|
[:site_name, :site_logo, :locale, :custom_domain]
|
|
else
|
|
[]
|
|
end
|
|
end
|
|
|
|
def create?
|
|
true
|
|
end
|
|
|
|
def update?
|
|
user.admin? and user.tenant_id == record.id
|
|
end
|
|
end |