diff --git a/ui/admin/app/templates/scopes/scope/auth-methods/auth-method/managed-groups.hbs b/ui/admin/app/templates/scopes/scope/auth-methods/auth-method/managed-groups.hbs
new file mode 100644
index 000000000..cfe68fbff
--- /dev/null
+++ b/ui/admin/app/templates/scopes/scope/auth-methods/auth-method/managed-groups.hbs
@@ -0,0 +1,3 @@
+{{page-title (t 'resources.managed-group.title_plural')}}
+
+{{outlet}}
\ No newline at end of file
diff --git a/ui/admin/app/templates/scopes/scope/auth-methods/auth-method/managed-groups/index.hbs b/ui/admin/app/templates/scopes/scope/auth-methods/auth-method/managed-groups/index.hbs
new file mode 100644
index 000000000..c482fd414
--- /dev/null
+++ b/ui/admin/app/templates/scopes/scope/auth-methods/auth-method/managed-groups/index.hbs
@@ -0,0 +1,86 @@
+{{#if @model}}
+
+
+
+ {{t 'form.name.label'}}
+ {{t 'form.description.label'}}
+ {{t 'form.type.label'}}
+ {{t 'form.id.label'}}
+
+
+
+
+ {{#each @model as |managed-group|}}
+
+
+ {{#if (can 'read model' managed-group)}}
+
+ {{managed-group.displayName}}
+
+ {{else}}
+ {{managed-group.displayName}}
+ {{/if}}
+
+ {{managed-group.description}}
+
+ {{managed-group.type}}
+
+
+
+ {{managed-group.id}}
+
+
+
+ {{/each}}
+
+
+{{else}}
+
+
+
+
+ {{#if
+ (can 'list collection' this.authMethod collection='managed-groups')
+ }}
+ {{! Can list (at least): show default welcome message }}
+ {{t 'resources.managed-group.description'}}
+ {{else if (can
+ 'create collection' this.authMethod collection='managed-groups'
+ )}}
+ {{! Can create only: show create but not list welcome message }}
+ {{t
+ 'descriptions.create-but-not-list'
+ resource=(t 'resources.managed-group.title_plural')
+ }}
+ {{else}}
+ {{! Can neither list nor create }}
+ {{t
+ 'descriptions.neither-list-nor-create'
+ resource=(t 'resources.managed-group.title_plural')
+ }}
+ {{/if}}
+
+
+ {{#if
+ (can 'create collection' this.authMethod collection='managed-groups')
+ }}
+
+
+ {{t 'resources.managed-group.actions.create'}}
+
+ {{/if}}
+
+
+{{/if}}
\ No newline at end of file
diff --git a/ui/admin/app/templates/scopes/scope/auth-methods/auth-method/managed-groups/managed-group.hbs b/ui/admin/app/templates/scopes/scope/auth-methods/auth-method/managed-groups/managed-group.hbs
new file mode 100644
index 000000000..a6696c3b6
--- /dev/null
+++ b/ui/admin/app/templates/scopes/scope/auth-methods/auth-method/managed-groups/managed-group.hbs
@@ -0,0 +1,2 @@
+{{page-title 'ManagedGroup'}}
+{{outlet}}
\ No newline at end of file
diff --git a/ui/admin/app/templates/scopes/scope/auth-methods/auth-method/managed-groups/managed-group/-actions.hbs b/ui/admin/app/templates/scopes/scope/auth-methods/auth-method/managed-groups/managed-group/-actions.hbs
new file mode 100644
index 000000000..3340d97f2
--- /dev/null
+++ b/ui/admin/app/templates/scopes/scope/auth-methods/auth-method/managed-groups/managed-group/-actions.hbs
@@ -0,0 +1,15 @@
+{{#if (can 'delete model' @model)}}
+
+
+ {{t 'resources.managed-group.actions.delete'}}
+
+
+{{/if}}
\ No newline at end of file
diff --git a/ui/admin/app/templates/scopes/scope/auth-methods/auth-method/managed-groups/managed-group/-header.hbs b/ui/admin/app/templates/scopes/scope/auth-methods/auth-method/managed-groups/managed-group/-header.hbs
new file mode 100644
index 000000000..1e7ef1124
--- /dev/null
+++ b/ui/admin/app/templates/scopes/scope/auth-methods/auth-method/managed-groups/managed-group/-header.hbs
@@ -0,0 +1,12 @@
+
+ {{t 'resources.managed-group.title'}}
+
+
+{{t 'resources.managed-group.description'}}
+
+ {{@model.id}}
+
\ No newline at end of file
diff --git a/ui/admin/app/templates/scopes/scope/auth-methods/auth-method/managed-groups/managed-group/-navigation.hbs b/ui/admin/app/templates/scopes/scope/auth-methods/auth-method/managed-groups/managed-group/-navigation.hbs
new file mode 100644
index 000000000..3a2ce54b7
--- /dev/null
+++ b/ui/admin/app/templates/scopes/scope/auth-methods/auth-method/managed-groups/managed-group/-navigation.hbs
@@ -0,0 +1,7 @@
+
+
+ {{t 'titles.details'}}
+
+
\ No newline at end of file
diff --git a/ui/admin/app/templates/scopes/scope/auth-methods/auth-method/managed-groups/managed-group/index.hbs b/ui/admin/app/templates/scopes/scope/auth-methods/auth-method/managed-groups/managed-group/index.hbs
new file mode 100644
index 000000000..bcaa893ac
--- /dev/null
+++ b/ui/admin/app/templates/scopes/scope/auth-methods/auth-method/managed-groups/managed-group/index.hbs
@@ -0,0 +1,5 @@
+
\ No newline at end of file
diff --git a/ui/admin/app/templates/scopes/scope/auth-methods/auth-method/managed-groups/new.hbs b/ui/admin/app/templates/scopes/scope/auth-methods/auth-method/managed-groups/new.hbs
new file mode 100644
index 000000000..bcaa893ac
--- /dev/null
+++ b/ui/admin/app/templates/scopes/scope/auth-methods/auth-method/managed-groups/new.hbs
@@ -0,0 +1,5 @@
+
\ No newline at end of file
diff --git a/ui/admin/app/templates/scopes/scope/auth-methods/auth-method/managed-groups/new/-header.hbs b/ui/admin/app/templates/scopes/scope/auth-methods/auth-method/managed-groups/new/-header.hbs
new file mode 100644
index 000000000..b6e89205e
--- /dev/null
+++ b/ui/admin/app/templates/scopes/scope/auth-methods/auth-method/managed-groups/new/-header.hbs
@@ -0,0 +1,5 @@
+
+ {{t 'titles.new'}}
+ {{! TODO: change the icon link }}
+
+
\ No newline at end of file
diff --git a/ui/admin/config/environment.js b/ui/admin/config/environment.js
index 771068764..613c6a3e8 100644
--- a/ui/admin/config/environment.js
+++ b/ui/admin/config/environment.js
@@ -48,6 +48,7 @@ module.exports = function (environment) {
account: '/accounts',
'account.new': '/accounts/new',
'auth-method': '/auth-methods',
+ 'managed-groups': '/managed-groups',
group: '/groups',
'group.add-members': '/groups/add-members',
'host-catalog': '/host-catalogs',
@@ -96,6 +97,7 @@ module.exports = function (environment) {
filter: false,
capabilities: true,
'credential-store': true,
+ 'managed-groups': false,
},
};
@@ -133,6 +135,7 @@ module.exports = function (environment) {
// Enable features in development
ENV.featureFlags['capabilities'] = true;
ENV.featureFlags['filter'] = true;
+ ENV.featureFlags['managed-groups'] = true;
}
if (environment === 'test') {
@@ -159,6 +162,7 @@ module.exports = function (environment) {
// Enable tests for development features
ENV.featureFlags['capabilities'] = true;
ENV.featureFlags['filter'] = true;
+ ENV.featureFlags['managed-groups'] = true;
}
if (environment === 'production') {
diff --git a/ui/admin/tests/acceptance/managed-groups/list-test.js b/ui/admin/tests/acceptance/managed-groups/list-test.js
new file mode 100644
index 000000000..dc2ad9e98
--- /dev/null
+++ b/ui/admin/tests/acceptance/managed-groups/list-test.js
@@ -0,0 +1,92 @@
+import { module, test } from 'qunit';
+import { visit, click, find } from '@ember/test-helpers';
+import { setupApplicationTest } from 'ember-qunit';
+import setupMirage from 'ember-cli-mirage/test-support/setup-mirage';
+import { authenticateSession } from 'ember-simple-auth/test-support';
+
+module('Acceptance | managed-groups | list', function (hooks) {
+ setupApplicationTest(hooks);
+ setupMirage(hooks);
+
+ const instances = {
+ scopes: {
+ global: null,
+ org: null,
+ },
+ authMethod: null,
+ managedGroup: null,
+ };
+ const urls = {
+ orgScope: null,
+ authMethods: null,
+ managedGroups: null,
+ newManagedGroup: null,
+ managedGroup: null,
+ };
+
+ hooks.beforeEach(function () {
+ authenticateSession({});
+ instances.scopes.global = this.server.create('scope', { id: 'global' });
+ instances.scopes.org = this.server.create('scope', {
+ type: 'org',
+ scope: { id: 'global', type: 'global' },
+ });
+ instances.authMethod = this.server.create('auth-method', {
+ scope: instances.scopes.org,
+ type: 'oidc',
+ });
+ instances.managedGroup = this.server.create('managed-group', {
+ scope: instances.scopes.org,
+ authMethod: instances.authMethod,
+ });
+ // Generate route URLs for resources
+ urls.orgScope = `/scopes/${instances.scopes.org.id}`;
+ urls.authMethods = `${urls.orgScope}/auth-methods`;
+ urls.authMethod = `${urls.authMethods}/${instances.authMethod.id}`;
+ urls.managedGroups = `${urls.authMethod}/managed-groups`;
+ urls.newManagedGroup = `${urls.managedGroups}/new`;
+ urls.managedGroup = `${urls.managedGroups}/${instances.authMethod.id}`;
+ });
+
+ hooks.afterEach(async function () {
+ const notification = find('.rose-notification');
+ if (notification) {
+ await click('.rose-notification-dismiss');
+ }
+ });
+
+ test('User can navigate to managed groups with proper authorization', async function (assert) {
+ assert.expect(2);
+ await visit(urls.authMethod);
+ assert.ok(
+ instances.authMethod.authorized_collection_actions[
+ 'managed-groups'
+ ].includes('list')
+ );
+ assert.ok(find(`[href="${urls.managedGroups}"]`));
+ });
+
+ test('User cannot navigate to index without either list or create actions', async function (assert) {
+ assert.expect(2);
+ instances.authMethod.authorized_collection_actions['managed-groups'] = [];
+ await visit(urls.authMethod);
+ assert.notOk(
+ instances.authMethod.authorized_collection_actions[
+ 'managed-groups'
+ ].includes('list')
+ );
+ assert.notOk(find(`[href="${urls.managedGroups}"]`));
+ });
+
+ test('User can navigate to index with only create action', async function (assert) {
+ assert.expect(2);
+ instances.authMethod.authorized_collection_actions['managed-groups'] = [
+ 'create',
+ ];
+ await visit(urls.authMethod);
+ assert.ok(find(`[href="${urls.managedGroups}"]`));
+ assert.ok(
+ find(`.rose-layout-page-actions [href="${urls.newManagedGroup}"]`)
+ );
+ });
+});
diff --git a/ui/admin/tests/unit/controllers/scopes/scope/auth-methods/auth-method/managed-groups-test.js b/ui/admin/tests/unit/controllers/scopes/scope/auth-methods/auth-method/managed-groups-test.js
new file mode 100644
index 000000000..7f976529b
--- /dev/null
+++ b/ui/admin/tests/unit/controllers/scopes/scope/auth-methods/auth-method/managed-groups-test.js
@@ -0,0 +1,17 @@
+import { module, test } from 'qunit';
+import { setupTest } from 'ember-qunit';
+
+module(
+ 'Unit | Controller | scopes/scope/auth-methods/auth-method/managed-groups',
+ function (hooks) {
+ setupTest(hooks);
+
+ // TODO: Replace this with your real tests.
+ test('it exists', function (assert) {
+ let controller = this.owner.lookup(
+ 'controller:scopes/scope/auth-methods/auth-method/managed-groups'
+ );
+ assert.ok(controller);
+ });
+ }
+);
diff --git a/ui/admin/tests/unit/controllers/scopes/scope/auth-methods/auth-method/managed-groups/managed-group-test.js b/ui/admin/tests/unit/controllers/scopes/scope/auth-methods/auth-method/managed-groups/managed-group-test.js
new file mode 100644
index 000000000..22284a9cf
--- /dev/null
+++ b/ui/admin/tests/unit/controllers/scopes/scope/auth-methods/auth-method/managed-groups/managed-group-test.js
@@ -0,0 +1,17 @@
+import { module, test } from 'qunit';
+import { setupTest } from 'ember-qunit';
+
+module(
+ 'Unit | Controller | scopes/scope/auth-methods/auth-method/managed-groups/managed-group',
+ function (hooks) {
+ setupTest(hooks);
+
+ // TODO: Replace this with your real tests.
+ test('it exists', function (assert) {
+ let controller = this.owner.lookup(
+ 'controller:scopes/scope/auth-methods/auth-method/managed-groups/managed-group'
+ );
+ assert.ok(controller);
+ });
+ }
+);
diff --git a/ui/admin/tests/unit/controllers/scopes/scope/auth-methods/auth-method/managed-groups/new-test.js b/ui/admin/tests/unit/controllers/scopes/scope/auth-methods/auth-method/managed-groups/new-test.js
new file mode 100644
index 000000000..699d52e58
--- /dev/null
+++ b/ui/admin/tests/unit/controllers/scopes/scope/auth-methods/auth-method/managed-groups/new-test.js
@@ -0,0 +1,17 @@
+import { module, test } from 'qunit';
+import { setupTest } from 'ember-qunit';
+
+module(
+ 'Unit | Controller | scopes/scope/auth-methods/auth-method/managed-groups/new',
+ function (hooks) {
+ setupTest(hooks);
+
+ // TODO: Replace this with your real tests.
+ test('it exists', function (assert) {
+ let controller = this.owner.lookup(
+ 'controller:scopes/scope/auth-methods/auth-method/managed-groups/new'
+ );
+ assert.ok(controller);
+ });
+ }
+);
diff --git a/ui/admin/tests/unit/routes/scopes/scope/auth-methods/auth-method/managed-groups-test.js b/ui/admin/tests/unit/routes/scopes/scope/auth-methods/auth-method/managed-groups-test.js
new file mode 100644
index 000000000..cb0c40319
--- /dev/null
+++ b/ui/admin/tests/unit/routes/scopes/scope/auth-methods/auth-method/managed-groups-test.js
@@ -0,0 +1,16 @@
+import { module, test } from 'qunit';
+import { setupTest } from 'ember-qunit';
+
+module(
+ 'Unit | Route | scopes/scope/auth-methods/auth-method/managed-groups',
+ function (hooks) {
+ setupTest(hooks);
+
+ test('it exists', function (assert) {
+ let route = this.owner.lookup(
+ 'route:scopes/scope/auth-methods/auth-method/managed-groups'
+ );
+ assert.ok(route);
+ });
+ }
+);
diff --git a/ui/admin/tests/unit/routes/scopes/scope/auth-methods/auth-method/managed-groups/index-test.js b/ui/admin/tests/unit/routes/scopes/scope/auth-methods/auth-method/managed-groups/index-test.js
new file mode 100644
index 000000000..269bb8663
--- /dev/null
+++ b/ui/admin/tests/unit/routes/scopes/scope/auth-methods/auth-method/managed-groups/index-test.js
@@ -0,0 +1,16 @@
+import { module, test } from 'qunit';
+import { setupTest } from 'ember-qunit';
+
+module(
+ 'Unit | Route | scopes/scope/auth-methods/auth-method/managed-groups/index',
+ function (hooks) {
+ setupTest(hooks);
+
+ test('it exists', function (assert) {
+ let route = this.owner.lookup(
+ 'route:scopes/scope/auth-methods/auth-method/managed-groups/index'
+ );
+ assert.ok(route);
+ });
+ }
+);
diff --git a/ui/admin/tests/unit/routes/scopes/scope/auth-methods/auth-method/managed-groups/managed-group-test.js b/ui/admin/tests/unit/routes/scopes/scope/auth-methods/auth-method/managed-groups/managed-group-test.js
new file mode 100644
index 000000000..f323d5e2e
--- /dev/null
+++ b/ui/admin/tests/unit/routes/scopes/scope/auth-methods/auth-method/managed-groups/managed-group-test.js
@@ -0,0 +1,16 @@
+import { module, test } from 'qunit';
+import { setupTest } from 'ember-qunit';
+
+module(
+ 'Unit | Route | scopes/scope/auth-methods/auth-method/managed-groups/managed-group',
+ function (hooks) {
+ setupTest(hooks);
+
+ test('it exists', function (assert) {
+ let route = this.owner.lookup(
+ 'route:scopes/scope/auth-methods/auth-method/managed-groups/managed-group'
+ );
+ assert.ok(route);
+ });
+ }
+);
diff --git a/ui/admin/tests/unit/routes/scopes/scope/auth-methods/auth-method/managed-groups/managed-group/index-test.js b/ui/admin/tests/unit/routes/scopes/scope/auth-methods/auth-method/managed-groups/managed-group/index-test.js
new file mode 100644
index 000000000..47aadd91a
--- /dev/null
+++ b/ui/admin/tests/unit/routes/scopes/scope/auth-methods/auth-method/managed-groups/managed-group/index-test.js
@@ -0,0 +1,16 @@
+import { module, test } from 'qunit';
+import { setupTest } from 'ember-qunit';
+
+module(
+ 'Unit | Route | scopes/scope/auth-methods/auth-method/managed-groups/managed-group/index',
+ function (hooks) {
+ setupTest(hooks);
+
+ test('it exists', function (assert) {
+ let route = this.owner.lookup(
+ 'route:scopes/scope/auth-methods/auth-method/managed-groups/managed-group/index'
+ );
+ assert.ok(route);
+ });
+ }
+);
diff --git a/ui/admin/tests/unit/routes/scopes/scope/auth-methods/auth-method/managed-groups/new-test.js b/ui/admin/tests/unit/routes/scopes/scope/auth-methods/auth-method/managed-groups/new-test.js
new file mode 100644
index 000000000..3ea26ad63
--- /dev/null
+++ b/ui/admin/tests/unit/routes/scopes/scope/auth-methods/auth-method/managed-groups/new-test.js
@@ -0,0 +1,16 @@
+import { module, test } from 'qunit';
+import { setupTest } from 'ember-qunit';
+
+module(
+ 'Unit | Route | scopes/scope/auth-methods/auth-method/managed-groups/new',
+ function (hooks) {
+ setupTest(hooks);
+
+ test('it exists', function (assert) {
+ let route = this.owner.lookup(
+ 'route:scopes/scope/auth-methods/auth-method/managed-groups/new'
+ );
+ assert.ok(route);
+ });
+ }
+);