"use strict";(self.webpackChunkweb_app=self.webpackChunkweb_app||[]).push([[1496],{31496:(e,t,i)=>{i.r(t),i.d(t,{default:()=>I});var s=i(69060),c=i(19536),a=i(51560),n=i(66152),o=i(61180),r=i(78256),l=i(21124),d=i(3992),u=i(61060),m=i(95705),S=i(2432),h=i(66156),_=i(82496);const I=()=>{const e=(0,h.Ab)(),t=(0,a.i6)(),i=(0,a.W4)(),I=(0,c.w1)(S.qO),[b,O]=(0,s.useState)("simple-tab-0"),[p,k]=(0,s.useState)(!0),[A,E]=(0,s.useState)([]),[L,P]=(0,s.useState)(!0),[U,C]=(0,s.useState)([]),N=i.bucketName||"",f=(0,d.i)(N,[l.Oi.ADMIN_LIST_USER_POLICIES]),T=(0,d.i)(N,[l.Oi.ADMIN_GET_POLICY,l.Oi.ADMIN_LIST_USERS,l.Oi.ADMIN_LIST_GROUPS],!0),g=(0,d.i)(l.Gc,[l.Oi.ADMIN_GET_USER]),x=(0,d.i)(l.Gc,[l.Oi.ADMIN_GET_POLICY,l.Oi.ADMIN_LIST_USERS,l.Oi.ADMIN_LIST_GROUPS]);(0,s.useEffect)((()=>{I&&(P(!0),k(!0))}),[I,P,k]);const M=[{type:"view",disableButtonFunction:()=>!x,onClick:e=>{t("".concat(l.Ks.POLICIES,"/").concat((0,u.CO)(e.name)))}}],y=[{type:"view",disableButtonFunction:()=>!g,onClick:e=>{t("".concat(l.Ks.USERS,"/").concat((0,u.CO)(e)))}}];return(0,s.useEffect)((()=>{L&&(T?o.m.bucketUsers.listUsersWithAccessToBucket(N).then((e=>{C(e.data),P(!1)})).catch((t=>{e((0,m.aW)((0,r.K)(t))),P(!1)})):P(!1))}),[L,e,N,T]),(0,s.useEffect)((()=>{e((0,m.i8)("bucket_detail_access"))}),[]),(0,s.useEffect)((()=>{p&&(f?o.m.bucketPolicy.listPoliciesWithBucket(N).then((e=>{E(e.data.policies),k(!1)})).catch((t=>{e((0,m.aW)((0,r.K)(t))),k(!1)})):k(!1))}),[p,e,N,f]),(0,_.jsxs)(s.Fragment,{children:[(0,_.jsx)(n.eCc,{separator:!0,children:(0,_.jsx)(n.M5Y,{content:(0,_.jsxs)(s.Fragment,{children:["Understand which"," ",(0,_.jsx)("a",{target:"blank",href:"https://min.io/docs/minio/linux/administration/identity-access-management/policy-based-access-control.html#",children:"Policies"})," ","and"," ",(0,_.jsx)("a",{target:"blank",href:"https://min.io/docs/minio/linux/administration/identity-access-management/minio-user-management.html",children:"Users"})," ","are authorized to access this Bucket."]}),placement:"right",children:"Access Audit"})}),(0,_.jsx)(n.kZJ,{currentTabOrPath:b,onTabClick:e=>{O(e)},horizontal:!0,options:[{tabConfig:{label:"Policies",id:"simple-tab-0"},content:(0,_.jsx)(d.K,{scopes:[l.Oi.ADMIN_LIST_USER_POLICIES],resource:N,errorProps:{disabled:!0},children:A&&(0,_.jsx)(n.iSL,{noBackground:!0,itemActions:M,columns:[{label:"Name",elementKey:"name"}],isLoading:p,records:A,entityName:"Policies",idField:"name"})})},{tabConfig:{label:"Users",id:"simple-tab-1"},content:(0,_.jsx)(d.K,{scopes:[l.Oi.ADMIN_GET_POLICY,l.Oi.ADMIN_LIST_USERS,l.Oi.ADMIN_LIST_GROUPS],resource:N,matchAll:!0,errorProps:{disabled:!0},children:(0,_.jsx)(n.iSL,{noBackground:!0,itemActions:y,columns:[{label:"User",elementKey:"accessKey"}],isLoading:L,records:U,entityName:"Users",idField:"accessKey"})})}]})]})}}}]);
//# sourceMappingURL=1496.e8c5dafd.chunk.js.map