"use strict";(self.webpackChunkgrafana=self.webpackChunkgrafana||[]).push([[7785],{19393:(P,u,s)=>{s.d(u,{Ay:()=>i});var n=s(74848),o=s(29675),c=s(99528),r=s(12786);const a=({uid:d})=>((0,r.oU)(d),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(c.Iz,{featureName:"data source permissions",featureId:"data-source-permissions"}),(0,n.jsx)(D,{})]})),D=({action:d})=>{const _=(0,o.$j)();return(0,n.jsx)(c.El,{action:d,featureName:"data source permissions",description:"With data source permissions, you can protect sensitive data by limiting access to this data source to specific users, teams, and roles.",listItems:["Protect sensitive data, like security logs, production databases, and personally-identifiable information","Clean up users\u2019 experience by hiding data sources they don\u2019t need to use","Share Grafana access more freely, knowing that users will not unwittingly see sensitive data"],image:`ds-permissions-${_.isLight?"light":"dark"}.png`,featureUrl:"https://grafana.com/docs/grafana/latest/enterprise/datasource_permissions"})},i=a},67072:(P,u,s)=>{s.r(u),s.d(u,{UpgradePage:()=>d,default:()=>_});var n=s(74848),o=s(54148),c=s(54122),r=s(12636),a=s(12786),D=s(61491),i=s(19393);const d=()=>{const{uid:M=""}=(0,o.g)(),O=(0,a.$m)("permissions"),p=(0,D.useSelector)(S=>S.navIndex),U=(0,r.tc)(p,`datasource-permissions-${M}`,O);return(0,n.jsx)(c.Y,{navId:"datasources",pageNav:U.main,children:(0,n.jsx)(c.Y.Contents,{children:(0,n.jsx)(i.Ay,{uid:M})})})},_=d},802:(P,u,s)=>{s.d(u,{$k:()=>A,BY:()=>U,S4:()=>T,Tn:()=>g,US:()=>S,Um:()=>C,_e:()=>B,hx:()=>v,k9:()=>m,oU:()=>p,u1:()=>I,xw:()=>h});var n=s(96540),o=s(40449),c=s(22492),r=s(87638),a=s(61491),D=s(91830),i=s(61674),d=s(47310),_=s(46760),M=s(26629),O=s(2196);const p=t=>{const e=(0,a.useDispatch)();(0,n.useEffect)(()=>(e((0,_.PK)(t)),function(){e((0,o.N)({cleanupAction:E=>E.dataSourceSettings=M.IJ}))}),[t,e])},U=t=>{const e=(0,a.useDispatch)();return()=>e((0,_.Ge)(t,i.b.DataSourcesEdit))},S=()=>{const t=(0,a.useDispatch)(),e=(0,a.useSelector)(E=>E.dataSources.isLoadingDataSources),l=(0,a.useSelector)(E=>E.dataSources.dataSources);return(0,n.useEffect)(()=>{t((0,_.bn)())},[t]),{isLoading:e,dataSources:l}},R=t=>{const e=useDispatch();useEffect(()=>{e(loadDataSource(t))},[e,t])},v=()=>{const t=(0,a.useDispatch)();(0,n.useEffect)(()=>{t((0,_.G2)())},[t])},C=()=>{const t=(0,a.useDispatch)();return e=>{t((0,_.du)(e,i.b.DataSourcesEdit))}},m=()=>{const t=(0,a.useDispatch)();return async e=>t((0,_.jB)(e))},A=()=>{const t=(0,a.useDispatch)(),{name:e}=(0,a.useSelector)(l=>l.dataSources.dataSource);return()=>{c.A.publish(new D.bY({title:"Delete",text:`Are you sure you want to delete the "${e}" data source?`,yesText:"Delete",icon:"trash-alt",onConfirm:()=>t((0,_.Qq)())}))}},h=t=>(0,a.useSelector)(e=>(0,O.U4)(e.dataSources,t)),g=t=>{const e=h(t);return(0,d.h)(e)},T=t=>(0,a.useSelector)(e=>(0,O.Fj)(e.dataSources,t)),B=()=>(0,a.useSelector)(t=>t.dataSourceSettings),I=t=>{const e=h(t),l=e.readOnly===!0,E=r.TP.hasPermissionInMetadata(a.AccessControlAction.DataSourcesWrite,e),L=r.TP.hasPermissionInMetadata(a.AccessControlAction.DataSourcesDelete,e);return{readOnly:l,hasWriteRights:E,hasDeleteRights:L}}},12786:(P,u,s)=>{s.d(u,{$k:()=>o.$k,$m:()=>c.$m,BY:()=>o.BY,Bs:()=>r.Bs,C_:()=>r.C_,S4:()=>o.S4,Tk:()=>r.Tk,Tn:()=>o.Tn,US:()=>o.US,Um:()=>o.Um,_e:()=>o._e,du:()=>n.du,eB:()=>r.eB,hp:()=>a.hp,hx:()=>o.hx,jz:()=>r.jz,k9:()=>o.k9,lv:()=>a.lv,oU:()=>o.oU,rb:()=>r.rb,u1:()=>o.u1,wC:()=>a.wC,xs:()=>a.xs,xw:()=>o.xw,zC:()=>a.zC});var n=s(46760),o=s(802),c=s(96326),r=s(26629),a=s(2196)},47310:(P,u,s)=>{s.d(u,{h:()=>c});var n=s(93407),o=s(2567);const c=r=>{const a=JSON.stringify({datasource:r.name,context:"explore"});return n.kM.renderUrl(o.I.assureBaseUrl("/explore"),{left:a})}}}]);

//# sourceMappingURL=DatasourcePermissionsUpgradePage.2591e852fd0603c08645.js.map