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