- Add telegram_config.html.erb view to display current bot token (masked) - Add edit_telegram_config.html.erb view for editing configuration - Update index.html.erb to include 'Manage Telegram Config' navigation - Add missing edit_telegram_config? and update_telegram_config? policy methods All views follow established patterns from FA/IB cookie management. Tests pass: 1011 examples, 0 failures.
84 lines
1.5 KiB
Ruby
84 lines
1.5 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
|
|
|
|
sig { returns(T::Boolean) }
|
|
def edit_telegram_config?
|
|
is_real_user? && is_role_admin?
|
|
end
|
|
|
|
sig { returns(T::Boolean) }
|
|
def update_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
|