diff --git a/app/controllers/account/applications_controller.rb b/app/controllers/account/applications_controller.rb new file mode 100644 index 0000000000..da4734bf2b --- /dev/null +++ b/app/controllers/account/applications_controller.rb @@ -0,0 +1,11 @@ +class Account::ApplicationsController < ApplicationController + layout "admin_layout" + + before_action :authenticate_user! + + def index + authorize :account_applications + + @applications = ::Doorkeeper::Application.where(show_on_dashboard: true).can_signin(current_user) + end +end diff --git a/app/policies/account_applications_policy.rb b/app/policies/account_applications_policy.rb new file mode 100644 index 0000000000..69902efd23 --- /dev/null +++ b/app/policies/account_applications_policy.rb @@ -0,0 +1,5 @@ +class AccountApplicationsPolicy < BasePolicy + def index? + current_user.govuk_admin? + end +end diff --git a/app/views/account/applications/index.html.erb b/app/views/account/applications/index.html.erb new file mode 100644 index 0000000000..1083c967ca --- /dev/null +++ b/app/views/account/applications/index.html.erb @@ -0,0 +1,34 @@ +<% content_for :title, "GOV.UK apps" %> + +<% content_for :breadcrumbs, + render("govuk_publishing_components/components/breadcrumbs", { + collapse_on_mobile: true, + breadcrumbs: [ + { + title: "Dashboard", + url: root_path, + }, + { + title: "GOV.UK apps", + } + ] + }) +%> + +
Name | +Description | +
---|---|
<%= application.name %> | +<%= application.description %> | +