@@ -55,13 +55,13 @@ const AccessDetails = () => {
5555 ] ) ;
5656
5757 const displayUsersList = hasPermission (
58- bucketName ,
59- [
60- IAM_SCOPES . ADMIN_GET_POLICY ,
61- IAM_SCOPES . ADMIN_LIST_USERS ,
62- IAM_SCOPES . ADMIN_LIST_GROUPS ,
63- ] ,
64- true ,
58+ bucketName ,
59+ [
60+ IAM_SCOPES . ADMIN_GET_POLICY ,
61+ IAM_SCOPES . ADMIN_LIST_USERS ,
62+ IAM_SCOPES . ADMIN_LIST_GROUPS ,
63+ ] ,
64+ true ,
6565 ) ;
6666
6767 const viewUser = hasPermission ( CONSOLE_UI_RESOURCE , [
@@ -104,15 +104,15 @@ const AccessDetails = () => {
104104 if ( loadingUsers ) {
105105 if ( displayUsersList ) {
106106 api . bucketUsers
107- . listUsersWithAccessToBucket ( bucketName )
108- . then ( ( res ) => {
109- setBucketUsers ( res . data ) ;
110- setLoadingUsers ( false ) ;
111- } )
112- . catch ( ( err ) => {
113- dispatch ( setErrorSnackMessage ( errorToHandler ( err ) ) ) ;
114- setLoadingUsers ( false ) ;
115- } ) ;
107+ . listUsersWithAccessToBucket ( bucketName )
108+ . then ( ( res ) => {
109+ setBucketUsers ( res . data ) ;
110+ setLoadingUsers ( false ) ;
111+ } )
112+ . catch ( ( err ) => {
113+ dispatch ( setErrorSnackMessage ( errorToHandler ( err ) ) ) ;
114+ setLoadingUsers ( false ) ;
115+ } ) ;
116116 } else {
117117 setLoadingUsers ( false ) ;
118118 }
@@ -128,82 +128,82 @@ const AccessDetails = () => {
128128 if ( loadingPolicies ) {
129129 if ( displayPoliciesList ) {
130130 api . bucketPolicy
131- . listPoliciesWithBucket ( bucketName )
132- . then ( ( res ) => {
133- setBucketPolicy ( res . data . policies ) ;
134- setLoadingPolicies ( false ) ;
135- } )
136- . catch ( ( err ) => {
137- dispatch ( setErrorSnackMessage ( errorToHandler ( err ) ) ) ;
138- setLoadingPolicies ( false ) ;
139- } ) ;
131+ . listPoliciesWithBucket ( bucketName )
132+ . then ( ( res ) => {
133+ setBucketPolicy ( res . data . policies ) ;
134+ setLoadingPolicies ( false ) ;
135+ } )
136+ . catch ( ( err ) => {
137+ dispatch ( setErrorSnackMessage ( errorToHandler ( err ) ) ) ;
138+ setLoadingPolicies ( false ) ;
139+ } ) ;
140140 } else {
141141 setLoadingPolicies ( false ) ;
142142 }
143143 }
144144 } , [ loadingPolicies , dispatch , bucketName , displayPoliciesList ] ) ;
145145
146146 return (
147- < Fragment >
148- < SectionTitle separator > Access Audit</ SectionTitle >
149- < Tabs
150- currentTabOrPath = { curTab }
151- onTabClick = { ( newValue : string ) => {
152- setCurTab ( newValue ) ;
153- } }
154- horizontal
155- options = { [
156- {
157- tabConfig : { label : "Policies" , id : "simple-tab-0" } ,
158- content : (
159- < SecureComponent
160- scopes = { [ IAM_SCOPES . ADMIN_LIST_USER_POLICIES ] }
161- resource = { bucketName }
162- errorProps = { { disabled : true } }
163- >
164- { bucketPolicy && (
165- < DataTable
166- noBackground = { true }
167- itemActions = { PolicyActions }
168- columns = { [ { label : "Name" , elementKey : "name" } ] }
169- isLoading = { loadingPolicies }
170- records = { bucketPolicy }
171- entityName = "Policies"
172- idField = "name"
173- />
174- ) }
175- </ SecureComponent >
176- ) ,
177- } ,
178- {
179- tabConfig : { label : "Users" , id : "simple-tab-1" } ,
180- content : (
181- < SecureComponent
182- scopes = { [
183- IAM_SCOPES . ADMIN_GET_POLICY ,
184- IAM_SCOPES . ADMIN_LIST_USERS ,
185- IAM_SCOPES . ADMIN_LIST_GROUPS ,
186- ] }
187- resource = { bucketName }
188- matchAll
189- errorProps = { { disabled : true } }
190- >
191- < DataTable
192- noBackground = { true }
193- itemActions = { userTableActions }
194- columns = { [ { label : "User" , elementKey : "accessKey" } ] }
195- isLoading = { loadingUsers }
196- records = { bucketUsers }
197- entityName = "Users"
198- idField = "accessKey"
199- />
200- </ SecureComponent >
201- ) ,
202- } ,
203- ] }
204- />
205- </ Fragment >
147+ < Fragment >
148+ < SectionTitle separator > Access Audit</ SectionTitle >
149+ < Tabs
150+ currentTabOrPath = { curTab }
151+ onTabClick = { ( newValue : string ) => {
152+ setCurTab ( newValue ) ;
153+ } }
154+ horizontal
155+ options = { [
156+ {
157+ tabConfig : { label : "Policies" , id : "simple-tab-0" } ,
158+ content : (
159+ < SecureComponent
160+ scopes = { [ IAM_SCOPES . ADMIN_LIST_USER_POLICIES ] }
161+ resource = { bucketName }
162+ errorProps = { { disabled : true } }
163+ >
164+ { bucketPolicy && (
165+ < DataTable
166+ noBackground = { true }
167+ itemActions = { PolicyActions }
168+ columns = { [ { label : "Name" , elementKey : "name" } ] }
169+ isLoading = { loadingPolicies }
170+ records = { bucketPolicy }
171+ entityName = "Policies"
172+ idField = "name"
173+ />
174+ ) }
175+ </ SecureComponent >
176+ ) ,
177+ } ,
178+ {
179+ tabConfig : { label : "Users" , id : "simple-tab-1" } ,
180+ content : (
181+ < SecureComponent
182+ scopes = { [
183+ IAM_SCOPES . ADMIN_GET_POLICY ,
184+ IAM_SCOPES . ADMIN_LIST_USERS ,
185+ IAM_SCOPES . ADMIN_LIST_GROUPS ,
186+ ] }
187+ resource = { bucketName }
188+ matchAll
189+ errorProps = { { disabled : true } }
190+ >
191+ < DataTable
192+ noBackground = { true }
193+ itemActions = { userTableActions }
194+ columns = { [ { label : "User" , elementKey : "accessKey" } ] }
195+ isLoading = { loadingUsers }
196+ records = { bucketUsers }
197+ entityName = "Users"
198+ idField = "accessKey"
199+ />
200+ </ SecureComponent >
201+ ) ,
202+ } ,
203+ ] }
204+ />
205+ </ Fragment >
206206 ) ;
207207} ;
208208
209- export default AccessDetails ;
209+ export default AccessDetails ;
0 commit comments