xref: /openbmc/webui-vue/src/views/SecurityAndAccess/UserManagement/TableRoles.vue (revision d36ac8a8be8636ddd0e64ce005d507b21bcdeb00)
1<template>
2  <b-table
3    stacked="sm"
4    hover
5    small
6    thead-class="table-light"
7    :items="items"
8    :fields="fields"
9  >
10    <template #cell(administrator)="data">
11      <template v-if="data.value">
12        <checkmark20 />
13      </template>
14    </template>
15    <template #cell(operator)="data">
16      <template v-if="data.value">
17        <checkmark20 />
18      </template>
19    </template>
20    <template #cell(readonly)="data">
21      <template v-if="data.value">
22        <checkmark20 />
23      </template>
24    </template>
25  </b-table>
26</template>
27
28<script>
29import Checkmark20 from '@carbon/icons-vue/es/checkmark/20';
30import i18n from '@/i18n';
31
32export default {
33  components: {
34    Checkmark20,
35  },
36  data() {
37    return {
38      items: [
39        {
40          description: i18n.global.t(
41            'pageUserManagement.tableRoles.configureComponentsManagedByThisService',
42          ),
43          administrator: true,
44          operator: true,
45          readonly: false,
46        },
47        {
48          description: i18n.global.t(
49            'pageUserManagement.tableRoles.configureManagerResources',
50          ),
51          administrator: true,
52          operator: false,
53          readonly: false,
54        },
55        {
56          description: i18n.global.t(
57            'pageUserManagement.tableRoles.updatePasswordForCurrentUserAccount',
58          ),
59          administrator: true,
60          operator: true,
61          readonly: true,
62        },
63        {
64          description: i18n.global.t(
65            'pageUserManagement.tableRoles.configureUsersAndTheirAccounts',
66          ),
67          administrator: true,
68          operator: false,
69          readonly: false,
70        },
71        {
72          description: i18n.global.t(
73            'pageUserManagement.tableRoles.logInToTheServiceAndReadResources',
74          ),
75          administrator: true,
76          operator: true,
77          readonly: true,
78        },
79      ],
80      fields: [
81        {
82          key: 'description',
83          label: i18n.global.t('pageUserManagement.tableRoles.privilege'),
84        },
85        {
86          key: 'administrator',
87          label: i18n.global.t('pageUserManagement.tableRoles.administrator'),
88          class: 'text-center',
89        },
90        {
91          key: 'operator',
92          label: i18n.global.t('pageUserManagement.tableRoles.operator'),
93          class: 'text-center',
94        },
95        {
96          key: 'readonly',
97          label: i18n.global.t('pageUserManagement.tableRoles.readOnly'),
98          class: 'text-center',
99        },
100      ],
101    };
102  },
103};
104</script>
105