"use strict";(self.webpackChunkweb_app=self.webpackChunkweb_app||[]).push([[6065],{76065:(e,t,s)=>{s.r(t),s.d(t,{default:()=>I});var c=s(65043),i=s(22166),n=s(73216),a=s(89923),o=s(56629),r=s(53518),l=s(99161),d=s(77938),u=s(56483),m=s(64159),_=s(39947),h=s(20554),S=s(70579);const I=()=>{const e=(0,h.jL)(),t=(0,n.Zp)(),s=(0,n.g)(),I=(0,i.d4)(_.Nx),[b,p]=(0,c.useState)("simple-tab-0"),[O,k]=(0,c.useState)(!0),[A,E]=(0,c.useState)([]),[U,f]=(0,c.useState)(!0),[L,N]=(0,c.useState)([]),P=s.bucketName||"",x=(0,d._)(P,[l.OV.ADMIN_LIST_USER_POLICIES]),g=(0,d._)(P,[l.OV.ADMIN_GET_POLICY,l.OV.ADMIN_LIST_USERS,l.OV.ADMIN_LIST_GROUPS],!0),C=(0,d._)(l.Ms,[l.OV.ADMIN_GET_USER]),M=(0,d._)(l.Ms,[l.OV.ADMIN_GET_POLICY,l.OV.ADMIN_LIST_USERS,l.OV.ADMIN_LIST_GROUPS]);(0,c.useEffect)((()=>{I&&(f(!0),k(!0))}),[I,f,k]);const T=[{type:"view",disableButtonFunction:()=>!M,onClick:e=>{t("".concat(l.zZ.POLICIES,"/").concat((0,u.nf)(e.name)))}}],V=[{type:"view",disableButtonFunction:()=>!C,onClick:e=>{t("".concat(l.zZ.USERS,"/").concat((0,u.nf)(e)))}}];return(0,c.useEffect)((()=>{U&&(g?o.F.bucketUsers.listUsersWithAccessToBucket(P).then((e=>{N(e.data),f(!1)})).catch((t=>{e((0,m.C9)((0,r.S)(t))),f(!1)})):f(!1))}),[U,e,P,g]),(0,c.useEffect)((()=>{e((0,m.ph)("bucket_detail_access"))}),[]),(0,c.useEffect)((()=>{O&&(x?o.F.bucketPolicy.listPoliciesWithBucket(P).then((e=>{E(e.data.policies),k(!1)})).catch((t=>{e((0,m.C9)((0,r.S)(t))),k(!1)})):k(!1))}),[O,e,P,x]),(0,S.jsxs)(c.Fragment,{children:[(0,S.jsx)(a._xt,{separator:!0,children:(0,S.jsx)(a.V7x,{content:(0,S.jsxs)(c.Fragment,{children:["Understand which"," ",(0,S.jsx)("a",{target:"blank",href:"https://min.io/docs/minio/linux/administration/identity-access-management/policy-based-access-control.html#",children:"Policies"})," ","and"," ",(0,S.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,S.jsx)(a.tUM,{currentTabOrPath:b,onTabClick:e=>{p(e)},horizontal:!0,options:[{tabConfig:{label:"Policies",id:"simple-tab-0"},content:(0,S.jsx)(d.R,{scopes:[l.OV.ADMIN_LIST_USER_POLICIES],resource:P,errorProps:{disabled:!0},children:A&&(0,S.jsx)(a.bQt,{noBackground:!0,itemActions:T,columns:[{label:"Name",elementKey:"name"}],isLoading:O,records:A,entityName:"Policies",idField:"name"})})},{tabConfig:{label:"Users",id:"simple-tab-1"},content:(0,S.jsx)(d.R,{scopes:[l.OV.ADMIN_GET_POLICY,l.OV.ADMIN_LIST_USERS,l.OV.ADMIN_LIST_GROUPS],resource:P,matchAll:!0,errorProps:{disabled:!0},children:(0,S.jsx)(a.bQt,{noBackground:!0,itemActions:V,columns:[{label:"User",elementKey:"accessKey"}],isLoading:U,records:L,entityName:"Users",idField:"accessKey"})})}]})]})}}}]);
//# sourceMappingURL=6065.f30b3ff2.chunk.js.map