Skip to content

Commit 9c4d18f

Browse files
hsato03Henrique Sato
andauthored
role ispublic param on UI (#7973)
Co-authored-by: Henrique Sato <[email protected]>
1 parent b2b707b commit 9c4d18f

File tree

4 files changed

+20
-6
lines changed

4 files changed

+20
-6
lines changed

api/src/main/java/org/apache/cloudstack/api/command/admin/acl/CreateRoleCmd.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,7 @@ public class CreateRoleCmd extends RoleCmd {
4848
description = "ID of the role to be cloned from. Either roleid or type must be passed in")
4949
private Long roleId;
5050

51-
@Parameter(name = ApiConstants.IS_PUBLIC, type = CommandType.BOOLEAN, description = "Indicates whether the role will be visible to all users (public) or only to root admins (private)." +
52-
" If this parameter is not specified during the creation of the role its value will be defaulted to true (public).")
51+
@Parameter(name = ApiConstants.IS_PUBLIC, type = CommandType.BOOLEAN, description = "Indicates whether the role will be visible to all users (public) or only to root admins (private). Default is true.")
5352
private boolean publicRole = true;
5453

5554
/////////////////////////////////////////////////////

ui/src/config/section/role.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export default {
2323
docHelp: 'adminguide/accounts.html#roles',
2424
permission: ['listRoles', 'listRolePermissions'],
2525
columns: ['name', 'type', 'description'],
26-
details: ['name', 'id', 'type', 'description'],
26+
details: ['name', 'id', 'type', 'description', 'ispublic'],
2727
tabs: [{
2828
name: 'details',
2929
component: shallowRef(defineAsyncComponent(() => import('@/components/view/DetailsTab.vue')))
@@ -53,7 +53,7 @@ export default {
5353
icon: 'edit-outlined',
5454
label: 'label.edit.role',
5555
dataView: true,
56-
args: ['name', 'description', 'type'],
56+
args: ['name', 'description', 'type', 'ispublic'],
5757
mapping: {
5858
type: {
5959
options: ['Admin', 'DomainAdmin', 'User']

ui/src/views/iam/CreateRole.vue

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,13 @@
9999
</a-select>
100100
</a-form-item>
101101

102+
<a-form-item name="ispublic" ref="ispublic">
103+
<template #label>
104+
<tooltip-label :title="$t('label.ispublic')" :tooltip="apiParams.ispublic.description"/>
105+
</template>
106+
<a-switch v-model:checked="form.ispublic"/>
107+
</a-form-item>
108+
102109
<div :span="24" class="action-button">
103110
<a-button @click="closeAction">{{ $t('label.cancel') }}</a-button>
104111
<a-button :loading="loading" ref="submit" type="primary" @click="handleSubmit">{{ $t('label.ok') }}</a-button>
@@ -150,7 +157,8 @@ export default {
150157
initForm () {
151158
this.formRef = ref()
152159
this.form = reactive({
153-
using: 'type'
160+
using: 'type',
161+
ispublic: true
154162
})
155163
this.rules = reactive({
156164
name: [{ required: true, message: this.$t('message.error.required.input') }],

ui/src/views/iam/ImportRole.vue

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,13 @@
8080
</a-select>
8181
</a-form-item>
8282

83+
<a-form-item name="ispublic" ref="ispublic">
84+
<template #label>
85+
<tooltip-label :title="$t('label.ispublic')" :tooltip="apiParams.ispublic.description"/>
86+
</template>
87+
<a-switch v-model:checked="form.ispublic"/>
88+
</a-form-item>
89+
8390
<a-form-item name="forced" ref="forced">
8491
<template #label>
8592
<tooltip-label :title="$t('label.forced')" :tooltip="apiParams.forced.description"/>
@@ -124,7 +131,7 @@ export default {
124131
methods: {
125132
initForm () {
126133
this.formRef = ref()
127-
this.form = reactive({})
134+
this.form = reactive({ ispublic: true })
128135
this.rules = reactive({
129136
file: [
130137
{ required: true, message: this.$t('message.error.required.input') },

0 commit comments

Comments
 (0)