74 lines
1.3 KiB
Ruby
74 lines
1.3 KiB
Ruby
# typed: strict
|
|
class GlobalStatePolicy < ApplicationPolicy
|
|
extend T::Sig
|
|
|
|
sig { returns(T::Boolean) }
|
|
def index?
|
|
is_real_user? && is_role_admin?
|
|
end
|
|
|
|
sig { returns(T::Boolean) }
|
|
def show?
|
|
is_real_user? && is_role_admin?
|
|
end
|
|
|
|
sig { returns(T::Boolean) }
|
|
def create?
|
|
is_real_user? && is_role_admin?
|
|
end
|
|
|
|
sig { returns(T::Boolean) }
|
|
def update?
|
|
is_real_user? && is_role_admin?
|
|
end
|
|
|
|
sig { returns(T::Boolean) }
|
|
def destroy?
|
|
is_real_user? && is_role_admin?
|
|
end
|
|
|
|
sig { returns(T::Boolean) }
|
|
def fa_cookies?
|
|
is_real_user? && is_role_admin?
|
|
end
|
|
|
|
sig { returns(T::Boolean) }
|
|
def edit_fa_cookies?
|
|
is_real_user? && is_role_admin?
|
|
end
|
|
|
|
sig { returns(T::Boolean) }
|
|
def update_fa_cookies?
|
|
is_real_user? && is_role_admin?
|
|
end
|
|
|
|
sig { returns(T::Boolean) }
|
|
def ib_cookies?
|
|
is_real_user? && is_role_admin?
|
|
end
|
|
|
|
sig { returns(T::Boolean) }
|
|
def edit_ib_cookies?
|
|
is_real_user? && is_role_admin?
|
|
end
|
|
|
|
sig { returns(T::Boolean) }
|
|
def update_ib_cookies?
|
|
is_real_user? && is_role_admin?
|
|
end
|
|
|
|
sig { returns(T::Boolean) }
|
|
def telegram_config?
|
|
is_real_user? && is_role_admin?
|
|
end
|
|
|
|
class Scope < ApplicationPolicy::Scope
|
|
extend T::Sig
|
|
|
|
sig { returns(T.untyped) }
|
|
def resolve
|
|
scope.all
|
|
end
|
|
end
|
|
end
|