diff --git a/addons/core/translations/resources/en-us.yaml b/addons/core/translations/resources/en-us.yaml
index 52bd07d03..4d373e26d 100644
--- a/addons/core/translations/resources/en-us.yaml
+++ b/addons/core/translations/resources/en-us.yaml
@@ -346,3 +346,8 @@ credential-library:
help: The body of the HTTP request the library sends to Vault when requesting credentials. Only allowed when HTTP method is set to POST.
types:
vault: Vault
+scope:
+ title: Scope
+ title_plural: Scopes
+ messages:
+ cannot_read: While you do not have permission to read this scope, you may have permission to view resources within it.
diff --git a/ui/admin/app/templates/scopes/scope/edit.hbs b/ui/admin/app/templates/scopes/scope/edit.hbs
index 648a03111..d8f6dc683 100644
--- a/ui/admin/app/templates/scopes/scope/edit.hbs
+++ b/ui/admin/app/templates/scopes/scope/edit.hbs
@@ -28,13 +28,15 @@
-
-
-
- {{t 'titles.details'}}
-
-
-
+ {{#if (can 'read model' @model)}}
+
+
+
+ {{t 'titles.details'}}
+
+
+
+ {{/if}}
{{#if (can 'delete model' @model)}}
@@ -59,11 +61,21 @@
{{/if}}
-
+ {{#if (can 'read model' @model)}}
+
+ {{else}}
+
+
+
+ {{t 'resources.scope.messages.cannot_read'}}
+
+
+
+ {{/if}}
\ No newline at end of file
diff --git a/ui/admin/tests/acceptance/scopes/read-test.js b/ui/admin/tests/acceptance/scopes/read-test.js
new file mode 100644
index 000000000..1ddd1e5a4
--- /dev/null
+++ b/ui/admin/tests/acceptance/scopes/read-test.js
@@ -0,0 +1,55 @@
+import { module, test } from 'qunit';
+import { visit, currentURL, find } from '@ember/test-helpers';
+import { setupApplicationTest } from 'ember-qunit';
+import setupMirage from 'ember-cli-mirage/test-support/setup-mirage';
+import a11yAudit from 'ember-a11y-testing/test-support/audit';
+import {
+ authenticateSession,
+ // These are left here intentionally for future reference.
+ //currentSession,
+ //invalidateSession,
+} from 'ember-simple-auth/test-support';
+
+module('Acceptance | scopes | read', function (hooks) {
+ setupApplicationTest(hooks);
+ setupMirage(hooks);
+
+ const instances = {
+ scopes: {
+ global: null,
+ org: null,
+ },
+ };
+ const urls = {
+ orgScopeEdit: null,
+ };
+
+ hooks.beforeEach(function () {
+ // Generate resources
+ instances.scopes.global = this.server.create('scope', { id: 'global' });
+ instances.scopes.org = this.server.create('scope', {
+ type: 'org',
+ scope: { id: 'global', type: 'global' },
+ });
+ // Generate route URLs for resources
+ urls.orgScopeEdit = `/scopes/${instances.scopes.org.id}/edit`;
+ // Generate resource couner
+ authenticateSession({});
+ });
+
+ test('visiting org scope edit', async function (assert) {
+ assert.expect(2);
+ await visit(urls.orgScopeEdit);
+ await a11yAudit();
+ assert.equal(currentURL(), urls.orgScopeEdit);
+ assert.ok(find('main .rose-form'));
+ });
+
+ test('visiting org scope edit without read permission results in no form displayed', async function (assert) {
+ assert.expect(2);
+ instances.scopes.org.update({ authorized_actions: [] });
+ await visit(urls.orgScopeEdit);
+ assert.equal(currentURL(), urls.orgScopeEdit);
+ assert.notOk(find('main .rose-form'));
+ });
+});