"use strict";(self.webpackChunkportal_ui=self.webpackChunkportal_ui||[]).push([[4738],{84738:function(e,t,c){c.r(t);var n=c(29439),s=c(72791),i=c(78687),o=c(57689),a=c(29945),u=c(31776),r=c(82342),l=c(56087),I=c(38442),S=c(45248),_=c(87995),f=c(9859),d=c(81551),F=c(80184);t.default=function(){var e=(0,d.TL)(),t=(0,o.s0)(),c=(0,o.UO)(),b=(0,i.v9)(f.HQ),L=(0,s.useState)("simple-tab-0"),h=(0,n.Z)(L,2),A=h[0],m=h[1],E=(0,s.useState)(!0),p=(0,n.Z)(E,2),N=p[0],P=p[1],T=(0,s.useState)([]),U=(0,n.Z)(T,2),k=U[0],C=U[1],D=(0,s.useState)(!0),M=(0,n.Z)(D,2),g=M[0],O=M[1],R=(0,s.useState)([]),y=(0,n.Z)(R,2),j=y[0],x=y[1],G=c.bucketName||"",v=(0,I.F)(G,[l.Ft.ADMIN_LIST_USER_POLICIES]),w=(0,I.F)(G,[l.Ft.ADMIN_GET_POLICY,l.Ft.ADMIN_LIST_USERS,l.Ft.ADMIN_LIST_GROUPS],!0),B=(0,I.F)(l.C3,[l.Ft.ADMIN_GET_USER]),Z=(0,I.F)(l.C3,[l.Ft.ADMIN_GET_POLICY,l.Ft.ADMIN_LIST_USERS,l.Ft.ADMIN_LIST_GROUPS]);(0,s.useEffect)((function(){b&&(O(!0),P(!0))}),[b,O,P]);var K=[{type:"view",disableButtonFunction:function(){return!Z},onClick:function(e){t("".concat(l.gA.POLICIES,"/").concat((0,S.LL)(e.name)))}}],Q=[{type:"view",disableButtonFunction:function(){return!B},onClick:function(e){t("".concat(l.gA.USERS,"/").concat((0,S.LL)(e)))}}];return(0,s.useEffect)((function(){g&&(w?u.h.bucketUsers.listUsersWithAccessToBucket(G).then((function(e){x(e.data),O(!1)})).catch((function(t){e((0,_.Ih)((0,r.g)(t))),O(!1)})):O(!1))}),[g,e,G,w]),(0,s.useEffect)((function(){e((0,_.Sc)("bucket_detail_access"))}),[]),(0,s.useEffect)((function(){N&&(v?u.h.bucketPolicy.listPoliciesWithBucket(G).then((function(e){C(e.data.policies),P(!1)})).catch((function(t){e((0,_.Ih)((0,r.g)(t))),P(!1)})):P(!1))}),[N,e,G,v]),(0,F.jsxs)(s.Fragment,{children:[(0,F.jsx)(a.NZf,{separator:!0,children:"Access Audit"}),(0,F.jsx)(a.mQc,{currentTabOrPath:A,onTabClick:function(e){m(e)},horizontal:!0,options:[{tabConfig:{label:"Policies",id:"simple-tab-0"},content:(0,F.jsx)(I.s,{scopes:[l.Ft.ADMIN_LIST_USER_POLICIES],resource:G,errorProps:{disabled:!0},children:k&&(0,F.jsx)(a.wQF,{noBackground:!0,itemActions:K,columns:[{label:"Name",elementKey:"name"}],isLoading:N,records:k,entityName:"Policies",idField:"name"})})},{tabConfig:{label:"Users",id:"simple-tab-1"},content:(0,F.jsx)(I.s,{scopes:[l.Ft.ADMIN_GET_POLICY,l.Ft.ADMIN_LIST_USERS,l.Ft.ADMIN_LIST_GROUPS],resource:G,matchAll:!0,errorProps:{disabled:!0},children:(0,F.jsx)(a.wQF,{noBackground:!0,itemActions:Q,columns:[{label:"User",elementKey:"accessKey"}],isLoading:g,records:j,entityName:"Users",idField:"accessKey"})})}]})]})}}}]);
//# sourceMappingURL=4738.0bbac05c.chunk.js.map