mirror of
https://github.com/lingble/chatwoot.git
synced 2025-11-24 23:15:11 +00:00
- Removes the portal_members table and all associated records - Updates policies to use custom roles with knowledge_base_manage permission - Updates controllers, models, and views to work without portal membership - Adds tests for the new permission model
28 lines
417 B
Ruby
28 lines
417 B
Ruby
class CategoryPolicy < ApplicationPolicy
|
|
def index?
|
|
@account.users.include?(@user)
|
|
end
|
|
|
|
def update?
|
|
@account_user.administrator?
|
|
end
|
|
|
|
def show?
|
|
@account_user.administrator?
|
|
end
|
|
|
|
def edit?
|
|
@account_user.administrator?
|
|
end
|
|
|
|
def create?
|
|
@account_user.administrator?
|
|
end
|
|
|
|
def destroy?
|
|
@account_user.administrator?
|
|
end
|
|
end
|
|
|
|
CategoryPolicy.prepend_mod_with('CategoryPolicy')
|