- 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
32 lines
465 B
Ruby
32 lines
465 B
Ruby
class PortalPolicy < ApplicationPolicy
|
|
def index?
|
|
@account.users.include?(@user)
|
|
end
|
|
|
|
def update?
|
|
@account_user.administrator?
|
|
end
|
|
|
|
def show?
|
|
@account.users.include?(@user)
|
|
end
|
|
|
|
def edit?
|
|
@account_user.administrator?
|
|
end
|
|
|
|
def create?
|
|
@account_user.administrator?
|
|
end
|
|
|
|
def destroy?
|
|
@account_user.administrator?
|
|
end
|
|
|
|
def logo?
|
|
@account_user.administrator?
|
|
end
|
|
end
|
|
|
|
PortalPolicy.prepend_mod_with('PortalPolicy')
|