Tidy up homepage and navigation

This commit is contained in:
Dan Milne
2025-11-09 20:58:13 +11:00
parent c9e2992fe0
commit 1f4428348d
56 changed files with 2822 additions and 955 deletions

View File

@@ -0,0 +1,8 @@
# frozen_string_literal: true
class AnalyticsPolicy < ApplicationPolicy
def index?
# Everyone can view analytics (including unauthenticated users for monitoring)
true
end
end

View File

@@ -0,0 +1,49 @@
# frozen_string_literal: true
class DsnPolicy < ApplicationPolicy
def index?
current_user.present? && current_user.admin?
end
def show?
current_user.present? && current_user.admin?
end
def create?
current_user.present? && current_user.admin?
end
def new?
create?
end
def update?
current_user.present? && current_user.admin?
end
def edit?
update?
end
def destroy?
current_user.present? && current_user.admin?
end
def disable?
current_user.present? && current_user.admin?
end
def enable?
current_user.present? && current_user.admin?
end
class Scope < Scope
def resolve
if user&.admin?
scope.all
else
scope.none
end
end
end
end