Skip to content

Commit

Permalink
Allow manual entries for identity type and ID
Browse files Browse the repository at this point in the history
  • Loading branch information
joelhulen committed Dec 12, 2024
1 parent d1c77ec commit ad138fb
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions src/ui/ManagementPortal/pages/security/role-assignments/create.vue
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,20 @@
<!-- Type -->
<div id="aria-principal-type" class="mb-2">Principal Type:</div>
<div style="display: flex; gap: 16px">
<InputText
<!-- <InputText
v-model="principal.object_type"
readonly
placeholder="Browse for selection"
type="text"
class="w-50"
aria-labelledby="aria-principal-type"
/> -->
<Dropdown
v-model="principal.object_type"
:options="principalTypeOptions"
placeholder="--Select--"
class="mb-2 w-100"
aria-labelledby="aria-principal-type"
/>
</div>

Expand Down Expand Up @@ -100,7 +107,6 @@
<div style="display: flex; gap: 16px">
<InputText
v-model="roleAssignment.principal_id"
readonly
placeholder="Browse for selection"
type="text"
class="w-50"
Expand Down Expand Up @@ -384,6 +390,14 @@ export default {
errors.push('Please specify a role.');
}
if (!this.roleAssignment.principal_type) {
if (this.principal.object_type) {
this.roleAssignment.principal_type = this.principal.object_type;
} else {
errors.push('Please specify a principal type.');
}
}
if (errors.length > 0) {
throw errors.join('\n');
}
Expand All @@ -392,6 +406,7 @@ export default {
let successMessage = null as null | string;
try {
this.loadingStatusText = 'Saving role assignment...';
await api.createRoleAssignment({
...this.roleAssignment,
name: uuidv4(),
Expand Down

0 comments on commit ad138fb

Please sign in to comment.