All Downloads are FREE. Search and download functionalities are using the official Maven repository.

web-interface.assets.bb8c8232-4411.9d6e1c8eceb2ac061299.js Maven / Gradle / Ivy

There is a newer version: 6.1.4
Show newest version
"use strict";(()=>{(self.webpackChunkgraylog_web_interface=self.webpackChunkgraylog_web_interface||[]).push([["bb8c8232-4411"],{SfPIQIJE:(b,p,t)=>{t.d(p,{A:()=>I});var e=t("Z7aTuO5B"),i=t("J6y4/h8P"),s=t("rIl5IEuP"),E=t("ty2gyrHp"),P=t("IOI9nV80"),g=t("NV1/EHMi");const y=(0,i.default)(s.ButtonToolbar)`
  margin-bottom: 10px;
`,f=(0,i.default)(s.Button)(({theme:u})=>(0,i.css)`
  font-family: ${u.fonts.family.navigation};
  font-size: ${u.fonts.size.navigation};
  color: ${u.colors.variant.darker.default};
  
  &:hover,
  &:focus {
    background: inherit;
    text-decoration: none;
  }

  &:hover {
    color: inherit;
    ${(0,g.WS)(u)}
  }

  &.active {
    color: ${u.colors.global.textDefault};

    ${(0,g.at)(u)}

    &:hover,
    &:focus {
      ${(0,g.at)(u)}
    }
`);f.displayName="Button";const I=({items:u})=>e.createElement(y,null,u.map(({path:c,title:U,permissions:R,exactPathMatch:D})=>c?e.createElement(P.Wj,{permissions:R!=null?R:[],key:c},e.createElement(E.m,{to:c,relativeActive:!D},e.createElement(f,{bsStyle:"link"},e.createElement(g.Ay,null,U)))):null))},"dan3/ZI+":(b,p,t)=>{t.d(p,{A:()=>i,n:()=>e.n});var e=t("xfUIbHjs");const i=e.A},"rbhKE1/U":(b,p,t)=>{t.d(p,{A:()=>P});var e=t("Z7aTuO5B"),i=t("rlwexfKi");const s=e.createElement("p",null,"Find role with a name containing manager:",e.createElement("br",null),e.createElement("kbd",null,"name:manager"),e.createElement("br",null)),P=()=>e.createElement(i.A,{entityName:"role",example:s,commonFields:["name","description"]})},P7lYJiUi:(b,p,t)=>{t.d(p,{A:()=>y});var e=t("Z7aTuO5B"),i=t("E+CaPsQD"),s=t("7dh0vSOR"),E=t("rIl5IEuP"),P=t("IOI9nV80");const y=()=>e.createElement(E.Row,{className:"content"},e.createElement(E.Col,{xs:12},e.createElement(E.Alert,{bsStyle:"info",title:"Granting Permissions"},"With Graylog 4.0, we've updated the permissions system. Granting permissions for an entity like streams and dashboards is no longer part of the user edit page. It can now be configured using the ",e.createElement("b",null,e.createElement(P.In,{name:"person_add"})," Share")," button of an entity. You can find the button e.g. on the entities overview page. Learn more in the ",e.createElement(s.A,{page:i.A.PAGES.PERMISSIONS,text:"documentation"}),".")))},ynz3ptM5:(b,p,t)=>{t.d(p,{A:()=>g});var e=t("Z7aTuO5B"),i=t("ty2gyrHp"),s=t("d4kzUuQm"),E=t("rIl5IEuP");const g=({userId:y,userIsReadOnly:f})=>e.createElement(E.ButtonToolbar,null,e.createElement(i.m,{to:s.Ay.SYSTEM.USERS.show(y)},e.createElement(E.Button,{bsStyle:"success"},"View Details")),!f&&e.createElement(i.m,{to:s.Ay.SYSTEM.USERS.edit(y)},e.createElement(E.Button,{bsStyle:"success"},"Edit User")),e.createElement(i.m,{to:s.Ay.SYSTEM.USERS.TOKENS.edit(y)},e.createElement(E.Button,{bsStyle:"success"},"Edit Tokens")))},WqhT36Vr:(b,p,t)=>{t.d(p,{A:()=>g});var e=t("Z7aTuO5B"),i=t("d4kzUuQm"),s=t("SfPIQIJE"),E=t("rIl5IEuP");const g=()=>{const y=[{title:"Users Overview",path:i.Ay.SYSTEM.USERS.OVERVIEW,permissions:"users:list"},{title:"Teams Overview",path:i.Ay.getPluginRoute("SYSTEM_TEAMS"),permissions:"teams:list"}];return e.createElement(E.Row,null,e.createElement(s.A,{items:y}))}},Lu0NTOJv:(b,p,t)=>{t.d(p,{A:()=>I});var e=t("KOKBnITH"),i=t("lDGobrly");const s=(0,i.A)({action:e.v.load,error:(u,c)=>({message:`Loading role with id "${c}" failed with status: ${u}`}),notFoundRedirect:!0}),E=(0,i.A)({action:e.v.delete,success:(u,c)=>({message:`Role "${c}" was deleted successfully`}),error:(u,c,U)=>({message:`Deleting role "${U}" failed with status: ${u}`})}),P=(0,i.A)({action:e.v.addMembers,success:(u,c)=>({message:`Users:"${c.join(", ")}" were assigned successfully`}),error:(u,c,U)=>({message:`Assigning users "${U.join(", ")}" failed with status: ${u}`})}),g=(0,i.A)({action:e.v.removeMember,success:(u,c)=>({message:`User "${c}" was unassigned successfully`}),error:(u,c,U)=>({message:`Unassign user "${U}" failed with status: ${u}`})}),y=(0,i.A)({action:e.v.loadUsersForRole,error:(u,c,U)=>({message:`Loading users for role "${U}" failed with status: ${u}`})}),f=(0,i.A)({action:e.v.loadRolesForUser,error:(u,c)=>({message:`Loading roles for user "${c}" failed with status: ${u}`})}),T=(0,i.A)({action:e.v.loadRolesPaginated,error:u=>({message:`Loading roles failed with status: ${u}`})}),I={load:s,delete:E,addMembers:P,removeMember:g,loadUsersForRole:y,loadRolesForUser:f,loadRolesPaginated:T}},MLDs3jaY:(b,p,t)=>{t.d(p,{A:()=>g});var e=t("Z7aTuO5B"),i=t("ibdPvtmL"),s=t("8fnsnG21");const E="org.graylog2.users.UserConfiguration",g=()=>{const y=(0,s.P)(i.H,T=>T==null?void 0:T.configuration[E]),f=(y==null?void 0:y.enable_global_session_timeout)||!1;return(0,e.useEffect)(()=>(i.t.list(E),()=>{}),[]),f}},"5tMkU7QT":(b,p,t)=>{t.d(p,{A:()=>u});var e=t("Z7aTuO5B"),i=t("UiXZqrDE"),s=t("2dBXfbRP"),E=t("QBkUz07U"),P=t("IOI9nV80"),g=t("rIl5IEuP"),y=t("2aaiYHqX"),f=t("RCNj0OY4"),T=t("Vmfu2XtV");const u=()=>{const[c,U]=(0,e.useState)(void 0),{enabled:R}=f.A.telemetry()||{},D=(0,s.sf)();if((0,e.useEffect)(()=>{y.g.get().then(A=>{U(A)})},[]),(0,e.useEffect)(()=>{R&&(c!=null&&c.telemetry_enabled)&&(D!=null&&D.has_opted_out_capturing())&&D.opt_in_capturing()},[R,D,c==null?void 0:c.telemetry_enabled]),!c)return e.createElement(P.y$,null);const C=A=>{D&&R&&!A.telemetry_enabled&&(D.capture("$opt_out"),D.opt_out_capturing())},$=(A,{setSubmitting:o})=>{C(A),y.g.update(A).then(()=>{o(!1),window.location.reload()})};return e.createElement(E.A,{title:"Telemetry"},e.createElement(T.A,null),e.createElement(i.Formik,{onSubmit:$,initialValues:c},({isSubmitting:A,isValid:o})=>e.createElement(i.Form,{className:"form form-horizontal"},e.createElement(g.Input,{id:"timeout-controls",labelClassName:"col-sm-3",wrapperClassName:"col-sm-9",label:"Enable telemetry"},e.createElement(P.o$,{label:"enabled",name:"telemetry_enabled",disabled:!R,formGroupClassName:"form-group no-bm",type:"checkbox"})),e.createElement(g.Row,{className:"no-bm"},e.createElement(g.Col,{xs:12},e.createElement("div",{className:"pull-right"},e.createElement(g.Button,{bsStyle:"success",disabled:A||!o||!R,title:"Update Preferences",type:"submit"},"Update telemetry")))))))}},"aXQp/Ie7":(b,p,t)=>{t.r(p),t.d(p,{default:()=>Be});var e=t("Z7aTuO5B"),i=t("c9JM82dZ"),s=t("IOI9nV80"),E=t("E+CaPsQD"),P=t("92lPlKXC"),g=t("3yfJIRSb"),y=t("QBkUz07U"),f=t("2aaiYHqX"),T=t("Vmfu2XtV");const u=()=>{var n;const[a,l]=(0,e.useState)(void 0);return(0,e.useEffect)(()=>{f.g.get().then(r=>{l(r)})},[]),a?e.createElement(y.A,{title:"Telemetry"},e.createElement(T.A,null),e.createElement(s.WY,{label:"Telemetry",value:(n=a.telemetry_enabled)!=null?n:!1})):e.createElement(s.y$,null)};var c=t("q2j1bVbz"),U=t("5tMkU7QT"),R=t("CCNXj2ra"),D=t("7GNmVOX8");const C={enableSmartSearch:!1,updateUnfocussed:!1,searchSidebarIsPinned:!1,dashboardSidebarIsPinned:!1},A=({user:{preferences:n,readOnly:a}})=>{var l;let r=n||C;if(a){const K={searchSidebarIsPinned:D.A.get("searchSidebarIsPinned"),dashboardSidebarIsPinned:D.A.get("dashboardSidebarIsPinned"),[R.vM]:D.A.get(R.vM)};r={...r,...K}}const{enableSmartSearch:S,updateUnfocussed:d,searchSidebarIsPinned:M,dashboardSidebarIsPinned:B}=r;return e.createElement(y.A,{title:"Preferences"},e.createElement(s.WY,{label:"Search autocompletion",value:S!=null?S:!1}),e.createElement(s.WY,{label:"Update unfocused",value:d!=null?d:!1}),e.createElement(s.WY,{label:"Pin search sidebar",value:M!=null?M:!1}),e.createElement(s.WY,{label:"Pin dashboard sidebar",value:B!=null?B:!1}),e.createElement(s.WY,{label:"Theme mode",value:(l=r==null?void 0:r[R.vM])!=null?l:"Not configured"}))},m=({user:{username:n,fullName:a,firstName:l,lastName:r,email:S,clientAddress:d,lastActivity:M,sessionActive:B,accountStatus:K,authServiceEnabled:Y}})=>{const H=()=>a&&!l&&!r;return e.createElement(y.A,{title:"Profile"},e.createElement(s.WY,{label:"Username",value:n}),H()&&e.createElement(s.WY,{label:"Full name",value:a}),e.createElement(s.WY,{label:"First Name",value:l}),e.createElement(s.WY,{label:"Last Name",value:r}),e.createElement(s.WY,{label:"E-Mail Address",value:S}),e.createElement(s.WY,{label:"Client Address",value:d}),e.createElement(s.WY,{label:"Last Activity",value:M}),e.createElement(s.WY,{label:"Logged In",value:B}),e.createElement(s.WY,{label:"Enabled",value:K==="enabled",help:!Y&&K==="enabled"?"Authentication service is disabled, user cannot log in":""}))};var v=t("Lu0NTOJv"),O=t("dan3/ZI+"),h=t("rbhKE1/U");const W=({user:{username:n}})=>{const[a,l]=(0,e.useState)(!1),r=(0,e.useCallback)((S,d)=>(l(!0),v.A.loadRolesForUser(n,S).then(M=>(d&&l(!1),M))),[n]);return e.createElement(y.A,{title:"Roles",showLoading:a},e.createElement(O.A,{noDataText:"No selected roles have been found.",onLoad:r,queryHelper:e.createElement(h.A,null)}))};var Z=t("Dg7SLLbb"),k=t.n(Z),x=t("d4kzUuQm"),F=t("ty2gyrHp"),q=t("pUKP3+Pg"),ee=t("iSSis/Yq"),te=t("MLDs3jaY");const ne=(n,a)=>{if(n){const l=e.createElement(s.Wj,{permissions:["clusterconfigentry:read"]},"(",e.createElement(F.N,{to:x.Ay.SYSTEM.CONFIGURATIONS},"globally set"),")");return e.createElement(e.Fragment,null,n.value," ",n.unitString," ",a&&l)}return"Sessions do not timeout"},se=({type:n,id:a})=>{const[l,r]=(0,e.useState)();if((0,e.useEffect)(()=>{!n||!a||(n==="stream"?q.t0.get(a).then(({title:d})=>r(d)):ee.u.get(a).then(({title:d})=>r(d)))},[a,n]),!n||!a)return e.createElement("span",null,"No start page set");const S=n==="stream"?x.Ay.stream_search(a):x.Ay.dashboard_show(a);return e.createElement(F.N,{to:S},e.createElement("b",null,k()(n)),":  ",l)},ae=({user:{timezone:n,serviceAccount:a,sessionTimeout:l,startpage:r}})=>{const S=(0,te.A)();return e.createElement(y.A,{title:"Settings"},e.createElement(s.WY,{label:"Sessions Timeout",value:ne(l,S)}),e.createElement(s.WY,{label:"Service Account",value:a}),e.createElement(s.WY,{label:"Timezone",value:n}),e.createElement(s.WY,{label:"Startpage",value:e.createElement(se,{type:r==null?void 0:r.type,id:r==null?void 0:r.id})}))};var N=t("J6y4/h8P"),le=t("VPaD/Np4"),re=t("EregcbZy");const z={searchPaginatedEntitySharesResponse:(n,a,l,r)=>{const S=new Array(a).fill({id:"grn::::stream:57bc9188e62a2373778d9e03",type:"stream",title:"Security Data",owners:[{id:"grn::::user:jane",type:"user",title:"Jane Doe"}]}),d={additionalQueries:r,total:230,count:Math.round(230/a),page:n||1,per_page:a||10,query:l||"",entities:S,context:{grantee_capabilities:{"grn::::stream:57bc9188e62a2373778d9e03":"view"}}};return Promise.resolve({list:le.List(d.entities.map(M=>re.A.fromJSON(M))),context:{granteeCapabilities:d.context.grantee_capabilities},pagination:{additionalQueries:d.additionalQueries,count:d.count,total:d.total,page:d.page,perPage:d.per_page,query:d.query}})},availableEntityTypes:{stream:"Stream",dashboard:"Dashboard",search:"Saved Search",event_definition:"Event Definition"},availableCapabilities:{own:"Owner",view:"Viewer",manage:"Manager"}};var oe=t("rlwexfKi");const ie=e.createElement("p",null,"Find shared entities with a title containing security:",e.createElement("br",null),e.createElement("kbd",null,"title:security"),e.createElement("br",null)),ce=()=>e.createElement(oe.A,{entityName:"shared entity",commonFields:["title"],example:ie}),me=(0,N.default)(s.B9)`
  display: inline-block;

  margin-bottom: 10px;
  margin-right: 15px;
`,de=N.default.div`
  display: inline-block;
  vertical-align: top;

  margin-right: 15px;
  margin-bottom: 10px;
`,Q=N.default.div`
  display: inline-flex;
  align-items: center;
  vertical-align: top;

  width: 260px;
  margin-left: 10px;
  margin-right: 10px;

  white-space: nowrap;
`,j=(0,N.default)(s.l6)`
  width: 300px;
  margin-left: 10px;
`,Ee=Object.entries(z.availableEntityTypes).map(([n,a])=>({label:a,value:n})),ue=Object.entries(z.availableCapabilities).map(([n,a])=>({label:a,value:n})),ve=({onSearch:n,onFilter:a})=>e.createElement(e.Fragment,null,e.createElement(me,{onReset:()=>n(""),onSearch:n,queryHelpComponent:e.createElement(ce,null),topMargin:0}),e.createElement(de,null,e.createElement(Q,null,e.createElement("label",{htmlFor:"entity-type-select"},"Entity Type"),e.createElement(j,{inputId:"entity-type-select",onChange:l=>a("entity_type",l),options:Ee,placeholder:"Filter entity types"})),e.createElement(Q,null,e.createElement("label",{htmlFor:"capability-select"},"Capability"),e.createElement(j,{inputId:"capability-select",onChange:l=>a("capability",l),options:ue,placeholder:"Filter capabilities"}))));var G=t("tz1fbBRX"),V=t("yGRmSjYM"),X=t("4E3oowBb");const J=({title:n,entityId:a})=>{const l=(0,G.A)(a);return e.createElement(F.N,{to:l},n)},ge=n=>{throw new Error(`Owner of entity has not supported type: ${n}`)},ye=({owner:{type:n,id:a,title:l}})=>{const r=(0,c.A)();switch(n){case"user":return(0,V.Nn)(r.permissions,"users:list")?e.createElement(J,{entityId:a,title:l}):e.createElement("span",null,l);case"team":return(0,V.Nn)(r.permissions,"teams:list")?e.createElement(J,{entityId:a,title:l}):e.createElement("span",null,l);case"global":return e.createElement("span",null,"Everyone");default:return ge(n)}},Ae=({owners:n})=>{const a=n.sort((l,r)=>(0,X.j)(l.type,r.type)||(0,X.j)(l.title,r.title));return e.createElement("td",{className:"limited"},a.map((l,r)=>{const S=r>=n.size-1;return e.createElement(e.Fragment,{key:l.id},e.createElement(ye,{owner:l}),!S&&", ")}).toArray())},Pe=({capabilityTitle:n,sharedEntity:{owners:a,title:l,type:r,id:S}})=>{const d=(0,G.A)(S);return e.createElement("tr",{key:l+r},e.createElement("td",{className:"limited"},e.createElement(F.N,{to:d},l)),e.createElement("td",{className:"limited"},r),e.createElement(Ae,{owners:a}),e.createElement("td",{className:"limited"},n))},pe=["Entity Name","Entity Type","Owner","Capability"],he={page:1,perPage:10,query:""},Se=(0,N.default)(s.OW)`
  .pagination {
    margin: 0;
  }
`,Oe=(n,{granteeCapabilities:a}={granteeCapabilities:void 0})=>{const l=a==null?void 0:a[n.id],r=z.availableCapabilities[l];return e.createElement(Pe,{sharedEntity:n,capabilityTitle:r})},fe=(n,a,l,r)=>{r(!0),a(n).then(S=>{r(!1),l(S)})},Te=({entityType:n,searchPaginated:a,setLoading:l})=>{const[r,S]=(0,e.useState)(),[d,M]=(0,e.useState)(he),{list:B,context:K,pagination:{total:Y}={total:0}}=r||{},{page:H,query:Ke,additionalQueries:Ne}=d;(0,e.useEffect)(()=>fe(d,a,S,l),[d,a,l]);const Fe=L=>M({...d,query:L}),Ye=(L,w)=>M({...d,query:Ke,additionalQueries:{...Ne,[L]:w}});return r?e.createElement(e.Fragment,null,e.createElement("p",{className:"description"},"Found ",Y," entities which are shared with the ",n,"."),e.createElement(Se,{activePage:H,totalItems:Y,onChange:(L,w)=>M({...d,page:L,perPage:w}),useQueryParameter:!1},e.createElement(s.bQ,{className:"table-hover",customFilter:e.createElement(ve,{onSearch:Fe,onFilter:Ye}),dataRowFormatter:L=>Oe(L,K),filterKeys:[],noDataText:e.createElement(s.EO,null,"No shared entities have been found."),headers:pe,id:"shared-entities",rowClassName:"no-bm",rows:B.toJS(),sortByKey:"type"}))):e.createElement(s.y$,null)};var Ue=t("5W3DTPWj");const Re=({userId:n})=>{const[a,l]=(0,e.useState)(!1),r=(0,e.useCallback)(S=>Ue.A.loadUserSharesPaginated(n,S),[n]);return e.createElement(y.A,{title:"Shared Entities",showLoading:a},e.createElement(Te,{setLoading:l,entityType:"user",searchPaginated:r}))};var De=t("QL8i6bcz");const Ie=({user:n})=>{var a;const l=De.d.exports("teams"),r=(a=l==null?void 0:l[0])==null?void 0:a.UserTeamsAssignment;return e.createElement(y.A,{title:"Teams"},r?e.createElement(r,{user:n,readOnly:!0}):e.createElement(s.Uk,{featureName:"teams"}))};var Me=t("P7lYJiUi");const be=({user:n})=>{const a=(0,c.A)(),l=a.id==="local:admin";return n?e.createElement(e.Fragment,null,e.createElement(g.A,null,e.createElement(s.Wj,{permissions:`users:edit:${n.username}`},e.createElement("div",null,e.createElement(m,{user:n}),e.createElement(s.Wj,{permissions:"*"},e.createElement(ae,{user:n})),e.createElement(A,{user:n})),e.createElement("div",null,e.createElement(Me.A,null),e.createElement(s.Wj,{permissions:`users:rolesedit:${n.username}`},e.createElement(W,{user:n})),e.createElement(s.Wj,{permissions:`teams:edit:${n.username}`},e.createElement(Ie,{user:n})),a.id===n.id&&!l&&e.createElement(s.Wj,{permissions:`users:edit:${n.username}`},e.createElement(u,null)),a.id===n.id&&l&&e.createElement(s.Wj,{permissions:`users:edit:${n.username}`},e.createElement(U.A,null))))),e.createElement(Re,{userId:n.id})):e.createElement(s.y$,null)};var Ce=t("WqhT36Vr"),_e=t("ynz3ptM5");const Le=({fullName:n})=>e.createElement(e.Fragment,null,"User Details ",n&&e.createElement(e.Fragment,null,"- ",e.createElement("i",null,n))),We=({params:n})=>{var a,l;const[r,S]=(0,e.useState)(),d=n==null?void 0:n.userId;return(0,e.useEffect)(()=>{P.A.load(d).then(S)},[d]),e.createElement(s.Qc,{title:`User Details ${(a=r==null?void 0:r.fullName)!=null?a:""}`},e.createElement(Ce.A,null),e.createElement(s.zY,{title:e.createElement(Le,{fullName:r==null?void 0:r.fullName}),actions:e.createElement(_e.A,{userId:d,userIsReadOnly:(l=r==null?void 0:r.readOnly)!=null?l:!1}),documentationLink:{title:"Permissions documentation",path:E.A.PAGES.USERS_ROLES}},e.createElement("span",null,"Overview of details like profile information, settings, teams and roles.")),e.createElement(be,{user:d===(r==null?void 0:r.id)?r:void 0}))},Be=(0,i.A)(We)},c9JM82dZ:(b,p,t)=>{t.d(p,{A:()=>E});var e=t("Z7aTuO5B"),i=t("yAXMqwrl");const E=P=>g=>{const y=(0,i.useParams)();return e.createElement(P,{...g,params:y})}},KOKBnITH:(b,p,t)=>{t.d(p,{v:()=>c});var e=t("JnTtTRmZ"),i=t.n(e),s=t("VPaD/Np4"),E=t("eFxcQyPT"),P=t("U1Iufsob"),g=t("MdYBRjRJ"),y=t("IA3Ku5lS"),f=t("gyRmhZSW");class T{constructor(o,m,v,O,h){this._value={id:o,name:m,description:v,permissions:O,readOnly:h}}get id(){return this._value.id}get name(){return this._value.name}get description(){return this._value.description}get permissions(){return this._value.permissions}get readOnly(){return this._value.readOnly}toBuilder(){const{id:o,name:m,description:v,permissions:O,readOnly:h}=this._value;return new I(s.Map({id:o,name:m,description:v,permissions:O,readOnly:h}))}static create(o,m,v,O,h){return new T(o,m,v,O,h)}toJSON(){const{id:o,name:m,description:v,permissions:O,readOnly:h}=this._value;return{id:o,name:m,description:v,permissions:O,read_only:h}}static fromJSON(o){const{id:m,name:v,description:O,permissions:h,read_only:_}=o;return T.create(m,v,O,h,_)}static builder(){return new I}}class I{constructor(o=s.Map()){this.value=o}id(o){return new I(this.value.set("id",o))}name(o){return new I(this.value.set("name",o))}description(o){return new I(this.value.set("description",o))}permissions(o){return new I(this.value.set("permissions",o))}readOnly(o){return new I(this.value.set("readOnly",o))}build(){const{id:o,name:m,description:v,permissions:O,readOnly:h}=this.value.toObject();return new T(o,m,v,O,h)}}const c=(0,y.rN)("AuthzRoles",()=>i().createActions({load:{asyncResult:!0},delete:{asyncResult:!0},addMembers:{asyncResult:!0},removeMember:{asyncResult:!0},loadUsersForRole:{asyncResult:!0},loadRolesForUser:{asyncResult:!0},loadRolesPaginated:{asyncResult:!0}}));var U=t("nmSm+aR9");const R=({count:A,total:o,page:m,per_page:v,query:O,roles:h=[],context:_={users:void 0}})=>({list:s.List(h.map(W=>T.fromJSON(W))),pagination:{query:O,page:m,perPage:v,count:A,total:o},context:_}),D=({count:A,total:o,page:m,per_page:v,query:O,users:h})=>({list:s.List(h.map(_=>U.A.fromJSON(_))),pagination:{page:m,perPage:v,query:O,count:A,total:o}}),C=(A,o=[])=>{const m=o.map(v=>encodeURIComponent(v));return A(...m).url},$=(0,y.Bv)("AuthzRoles",()=>i().createStore({listenables:[c],load(A){const o=(0,g.H3)(C(P.A.AuthzRolesController.load,[A])),m=(0,E.Ay)("GET",o).then(T.fromJSON);return c.load.promise(m),m},delete(A){const o=(0,g.H3)(C(P.A.AuthzRolesController.delete,[A])),m=(0,E.Ay)("DELETE",o);return c.delete.promise(m),m},addMembers(A,o){const m=C(P.A.AuthzRolesController.addMembers,[A]),v=(0,E.Ay)("PUT",(0,g.H3)(m),o.toArray());return c.addMembers.promise(v),v},removeMember(A,o){const m=C(P.A.AuthzRolesController.removeMember,[A,o]),v=(0,E.Ay)("DELETE",(0,g.H3)(m));return c.removeMember.promise(v),v},loadUsersForRole(A,o,{page:m,perPage:v,query:O}){const h=C(P.A.AuthzRolesController.loadUsersForRole,[A]),_=(0,f.A)(h,m,v,O),W=(0,E.Ay)("GET",(0,g.H3)(_)).then(D);return c.loadUsersForRole.promise(W),W},loadRolesForUser(A,{page:o,perPage:m,query:v}){const O=C(P.A.AuthzRolesController.loadRolesForUser,[A]),h=(0,f.A)(O,o,m,v),_=(0,E.Ay)("GET",(0,g.H3)(h)).then(R);return c.loadRolesForUser.promise(_),_},loadRolesPaginated({page:A,perPage:o,query:m}){const v=C(P.A.AuthzRolesController.list),O=(0,f.A)(v,A,o,m),h=(0,E.Ay)("GET",(0,g.H3)(O)).then(R);return c.loadRolesPaginated.promise(h),h}}))}}]);})();

//# sourceMappingURL=bb8c8232-4411.9d6e1c8eceb2ac061299.js.map




© 2015 - 2024 Weber Informatics LLC | Privacy Policy