@@ -32,7 +32,6 @@ import spacing from "@patternfly/react-styles/css/utilities/Spacing/spacing";
32
32
import CubesIcon from "@patternfly/react-icons/dist/esm/icons/cubes-icon" ;
33
33
34
34
import { AppPlaceholder } from "@app/components/AppPlaceholder" ;
35
- import { AppTableActionButtons } from "@app/components/AppTableActionButtons" ;
36
35
import { ConditionalRender } from "@app/components/ConditionalRender" ;
37
36
import { ConfirmDialog } from "@app/components/ConfirmDialog" ;
38
37
import { getAxiosErrorMessage } from "@app/utils/utils" ;
@@ -51,6 +50,8 @@ import {
51
50
TableRowContentWithControls ,
52
51
} from "@app/components/TableControls" ;
53
52
import { StakeholderForm } from "./components/stakeholder-form" ;
53
+ import { controlsWriteScopes , RBAC , RBAC_TYPE } from "@app/rbac" ;
54
+ import { ControlTableActionButtons } from "../ControlTableActionButtons" ;
54
55
55
56
export const Stakeholders : React . FC = ( ) => {
56
57
const { t } = useTranslation ( ) ;
@@ -210,17 +211,22 @@ export const Stakeholders: React.FC = () => {
210
211
< ToolbarContent >
211
212
< FilterToolbar { ...filterToolbarProps } />
212
213
< ToolbarGroup variant = "button-group" >
213
- < ToolbarItem >
214
- < Button
215
- type = "button"
216
- id = "create-stakeholder"
217
- aria-label = "Create new stakeholder"
218
- variant = { ButtonVariant . primary }
219
- onClick = { ( ) => setCreateUpdateModalState ( "create" ) }
220
- >
221
- { t ( "actions.createNew" ) }
222
- </ Button >
223
- </ ToolbarItem >
214
+ < RBAC
215
+ allowedPermissions = { controlsWriteScopes }
216
+ rbacType = { RBAC_TYPE . Scope }
217
+ >
218
+ < ToolbarItem >
219
+ < Button
220
+ type = "button"
221
+ id = "create-stakeholder"
222
+ aria-label = "Create new stakeholder"
223
+ variant = { ButtonVariant . primary }
224
+ onClick = { ( ) => setCreateUpdateModalState ( "create" ) }
225
+ >
226
+ { t ( "actions.createNew" ) }
227
+ </ Button >
228
+ </ ToolbarItem >
229
+ </ RBAC >
224
230
</ ToolbarGroup >
225
231
< ToolbarItem { ...paginationToolbarItemProps } >
226
232
< SimplePagination
@@ -299,7 +305,7 @@ export const Stakeholders: React.FC = () => {
299
305
>
300
306
{ stakeholder . stakeholderGroups ?. length }
301
307
</ Td >
302
- < AppTableActionButtons
308
+ < ControlTableActionButtons
303
309
onEdit = { ( ) =>
304
310
setCreateUpdateModalState ( stakeholder )
305
311
}
0 commit comments