web-interface.assets.bb8c8232-4923.81d1d6eaec12319d4c0a.js Maven / Gradle / Ivy
"use strict";(()=>{(self.webpackChunkgraylog_web_interface=self.webpackChunkgraylog_web_interface||[]).push([["bb8c8232-4923"],{"rbhKE1/U":(I,b,o)=>{o.d(b,{A:()=>p});var e=o("Z7aTuO5B"),R=o("rlwexfKi");const g=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(R.A,{entityName:"role",example:g,commonFields:["name","description"]})},Lu0NTOJv:(I,b,o)=>{o.d(b,{A:()=>A});var e=o("KOKBnITH"),R=o("lDGobrly");const g=(0,R.A)({action:e.v.load,error:(d,a)=>({message:`Loading role with id "${a}" failed with status: ${d}`}),notFoundRedirect:!0}),h=(0,R.A)({action:e.v.delete,success:(d,a)=>({message:`Role "${a}" was deleted successfully`}),error:(d,a,O)=>({message:`Deleting role "${O}" failed with status: ${d}`})}),p=(0,R.A)({action:e.v.addMembers,success:(d,a)=>({message:`Users:"${a.join(", ")}" were assigned successfully`}),error:(d,a,O)=>({message:`Assigning users "${O.join(", ")}" failed with status: ${d}`})}),f=(0,R.A)({action:e.v.removeMember,success:(d,a)=>({message:`User "${a}" was unassigned successfully`}),error:(d,a,O)=>({message:`Unassign user "${O}" failed with status: ${d}`})}),E=(0,R.A)({action:e.v.loadUsersForRole,error:(d,a,O)=>({message:`Loading users for role "${O}" failed with status: ${d}`})}),y=(0,R.A)({action:e.v.loadRolesForUser,error:(d,a)=>({message:`Loading roles for user "${a}" failed with status: ${d}`})}),w=(0,R.A)({action:e.v.loadRolesPaginated,error:d=>({message:`Loading roles failed with status: ${d}`})}),A={load:g,delete:h,addMembers:p,removeMember:f,loadUsersForRole:E,loadRolesForUser:y,loadRolesPaginated:w}},"6hz9dfSj":(I,b,o)=>{o.r(b),o.d(b,{default:()=>q});var e=o("Z7aTuO5B"),R=o("ty2gyrHp"),g=o("J6y4/h8P"),h=o("QL8i6bcz"),p=o("Lu0NTOJv"),f=o("KOKBnITH"),E=o("IOI9nV80"),y=o("rIl5IEuP"),w=o("rVdVsuGH"),A=o("VPaD/Np4"),d=o("d4kzUuQm");const a=g.default.div`
display: flex;
justify-content: flex-end;
`,O=(s,l,v)=>{let c=`Do you really want to delete role "${l}"?`;const U={page:1,perPage:1,query:""};v(!0),p.A.loadUsersForRole(s,l,U).then(C=>{C.pagination.total>=1&&(c+=`
It is still assigned to ${C.pagination.total} users.`),window.confirm(c)?p.A.delete(s,l).then(()=>{v(!1)}):v(!1)})},z=({roleId:s,roleName:l,readOnly:v})=>{const[c,U]=(0,e.useState)(!1);return e.createElement("td",null,e.createElement(a,null,e.createElement(E.Wj,{permissions:[`roles:edit:${l}`]},e.createElement(R.m,{to:d.Ay.SYSTEM.AUTHZROLES.edit(encodeURIComponent(s))},e.createElement(y.Button,{id:`edit-role-${s}`,bsSize:"xs",title:`Edit role ${l}`,type:"button"},"Edit"))),!v&&e.createElement(E.Wj,{permissions:[`roles:delete:${l}`]},e.createElement(e.Fragment,null,"\xA0",e.createElement(y.Button,{id:`delete-role-${s}`,bsStyle:"danger",bsSize:"xs",title:`Delete role ${l}`,onClick:()=>O(s,l,U),type:"button"},c?e.createElement(E.y$,{text:"Deleting",delay:0}):"Delete")))))},P=10,u=({users:s=A.Set()})=>{const l=s.size,v=s.take(P).toArray().map(({id:c,username:U},C)=>e.createElement(E.Wj,{permissions:[`users:read:${U}`],key:c},e.createElement(e.Fragment,null,e.createElement(R.N,{to:d.Ay.SYSTEM.USERS.show(c)},U),CP&&v.push(e.createElement("span",{key:"dots"},"...")),e.createElement("td",null,e.createElement(E.xz,null,s.size)," ",v)},t=g.default.td`
max-width: 300px;
`,r=({role:{id:s,name:l,description:v,readOnly:c},users:U})=>e.createElement("tr",{key:s},e.createElement("td",{className:"limited"},e.createElement(R.N,{to:d.Ay.SYSTEM.AUTHZROLES.show(s)},l)),e.createElement(t,null,e.createElement(E.tJ,null,v)),e.createElement(u,{users:A.Set(U)}),e.createElement(z,{roleId:s,roleName:l,readOnly:c}));var m=o("rbhKE1/U");const i=g.default.div`
margin-bottom: 10px;
`,T=({onSearch:s})=>e.createElement(i,null,e.createElement(E.B9,{onSearch:s,onReset:()=>s(""),queryHelpComponent:e.createElement(m.A,null),topMargin:0})),W=["Name","Description","Users","Actions"],G=g.default.div`
.data-table {
overflow-x: visible;
}
`,J=g.default.div`
display: flex;
align-items: center;
`,Q=(0,g.default)(E.y$)(({theme:s})=>`
margin-left: 10px;
font-size: ${s.fonts.size.h3};
`),j=(0,g.default)(E.OW)`
.pagination {
margin: 0;
}
`,V=s=>{switch(s.toLowerCase()){case"actions":return e.createElement("th",{className:"actions text-right"},s);default:return e.createElement("th",null,s)}},x=(s,l,v)=>{l(!0),p.A.loadRolesPaginated(s).then(c=>{v(c),l(!1)})},Y=(s,l,v,c)=>f.v.delete.completed.listen(()=>{x(s,l,v),c()}),Z=()=>{var s;const l=()=>({loading:!1,users:[]}),v=h.d.exports("teams");return((s=v==null?void 0:v[0])==null?void 0:s.useTeamMembersByRole)||l},X=()=>{const{page:s,pageSize:l,resetPage:v}=(0,w.Ay)(),[c,U]=(0,e.useState)(),[C,B]=(0,e.useState)(!1),[M,_]=(0,e.useState)(""),{list:ee}=c||{},D=Z()();(0,e.useEffect)(()=>x({page:s,perPage:l,query:M},B,U),[s,l,M]),(0,e.useEffect)(()=>Y({page:s,perPage:l,query:M},B,U,v),[s,l,M,v]);const te=L=>{v(),_(L)},se=(0,e.useCallback)(L=>{var N;const{id:F}=L,ne=c==null?void 0:c.context.users[F],re=D.users[F]?[...D.users[F],...ne]:(N=c==null?void 0:c.context)==null?void 0:N.users[F];return e.createElement(r,{role:L,users:re})},[D,c==null?void 0:c.context]);if(!c)return e.createElement(E.y$,null);const oe=e.createElement(T,{onSearch:te});return e.createElement(G,null,e.createElement(y.Row,{className:"content"},e.createElement(y.Col,{xs:12},e.createElement(J,null,e.createElement("h2",null,"Roles"),C&&e.createElement(Q,{text:"",delay:0})),e.createElement("p",{className:"description"},"Found ",c.pagination.total," roles on the system."),e.createElement(j,{totalItems:c.pagination.total},e.createElement(E.bQ,{id:"roles-overview",className:"table-hover",rowClassName:"no-bm",headers:W,headerCellFormatter:V,sortByKey:"name",rows:ee.toJS(),noDataText:e.createElement(E.EO,null,"No roles have been found."),customFilter:oe,dataRowFormatter:se,filterKeys:[],filterLabel:"Filter Roles"})))))};var H=o("E+CaPsQD"),k=o("7dh0vSOR");const q=()=>e.createElement(E.Qc,{title:"Roles Overview"},e.createElement(E.zY,{title:"Roles Overview",documentationLink:{title:"Permissions documentation",path:H.A.PAGES.USERS_ROLES},topActions:e.createElement(R.m,{to:d.Ay.SYSTEM.AUTHZROLES.OVERVIEW},e.createElement(y.Button,{bsStyle:"info"},"Roles Overview"))},e.createElement("span",null,"Overview of Graylog's roles. Roles allow granting capabilities to users, like creating dashboards or event definitions.")),e.createElement(y.Row,{className:"content"},e.createElement(y.Col,{xs:12},e.createElement(y.Alert,{bsStyle:"info",title:e.createElement(e.Fragment,null,"Granting Permissions")},"With Graylog 4.0, we've updated the permissions system and changed the purpose of roles. The built-in roles still allow granting capabilities to users, like creating dashboards or viewing the archive catalog. But they no longer grant permissions for a specific dashboard or stream. It is also not possible to create an own role. Granting permissions for a specific entity can now be done by using its ",e.createElement("b",null,e.createElement(E.In,{name:"person_add"})," Share")," button. You can find the button e.g. on the entities overview page. If you want to grant permissions for an entity to multiple users at once, you can use teams. Learn more in the ",e.createElement(k.A,{page:H.A.PAGES.PERMISSIONS,text:"documentation"}),"."))),e.createElement(X,null))},KOKBnITH:(I,b,o)=>{o.d(b,{v:()=>a});var e=o("JnTtTRmZ"),R=o.n(e),g=o("VPaD/Np4"),h=o("eFxcQyPT"),p=o("U1Iufsob"),f=o("MdYBRjRJ"),E=o("IA3Ku5lS"),y=o("gyRmhZSW");class w{constructor(t,n,r,m,i){this._value={id:t,name:n,description:r,permissions:m,readOnly:i}}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:t,name:n,description:r,permissions:m,readOnly:i}=this._value;return new A(g.Map({id:t,name:n,description:r,permissions:m,readOnly:i}))}static create(t,n,r,m,i){return new w(t,n,r,m,i)}toJSON(){const{id:t,name:n,description:r,permissions:m,readOnly:i}=this._value;return{id:t,name:n,description:r,permissions:m,read_only:i}}static fromJSON(t){const{id:n,name:r,description:m,permissions:i,read_only:S}=t;return w.create(n,r,m,i,S)}static builder(){return new A}}class A{constructor(t=g.Map()){this.value=t}id(t){return new A(this.value.set("id",t))}name(t){return new A(this.value.set("name",t))}description(t){return new A(this.value.set("description",t))}permissions(t){return new A(this.value.set("permissions",t))}readOnly(t){return new A(this.value.set("readOnly",t))}build(){const{id:t,name:n,description:r,permissions:m,readOnly:i}=this.value.toObject();return new w(t,n,r,m,i)}}const a=(0,E.rN)("AuthzRoles",()=>R().createActions({load:{asyncResult:!0},delete:{asyncResult:!0},addMembers:{asyncResult:!0},removeMember:{asyncResult:!0},loadUsersForRole:{asyncResult:!0},loadRolesForUser:{asyncResult:!0},loadRolesPaginated:{asyncResult:!0}}));var O=o("nmSm+aR9");const $=({count:u,total:t,page:n,per_page:r,query:m,roles:i=[],context:S={users:void 0}})=>({list:g.List(i.map(T=>w.fromJSON(T))),pagination:{query:m,page:n,perPage:r,count:u,total:t},context:S}),z=({count:u,total:t,page:n,per_page:r,query:m,users:i})=>({list:g.List(i.map(S=>O.A.fromJSON(S))),pagination:{page:n,perPage:r,query:m,count:u,total:t}}),P=(u,t=[])=>{const n=t.map(r=>encodeURIComponent(r));return u(...n).url},K=(0,E.Bv)("AuthzRoles",()=>R().createStore({listenables:[a],load(u){const t=(0,f.H3)(P(p.A.AuthzRolesController.load,[u])),n=(0,h.Ay)("GET",t).then(w.fromJSON);return a.load.promise(n),n},delete(u){const t=(0,f.H3)(P(p.A.AuthzRolesController.delete,[u])),n=(0,h.Ay)("DELETE",t);return a.delete.promise(n),n},addMembers(u,t){const n=P(p.A.AuthzRolesController.addMembers,[u]),r=(0,h.Ay)("PUT",(0,f.H3)(n),t.toArray());return a.addMembers.promise(r),r},removeMember(u,t){const n=P(p.A.AuthzRolesController.removeMember,[u,t]),r=(0,h.Ay)("DELETE",(0,f.H3)(n));return a.removeMember.promise(r),r},loadUsersForRole(u,t,{page:n,perPage:r,query:m}){const i=P(p.A.AuthzRolesController.loadUsersForRole,[u]),S=(0,y.A)(i,n,r,m),T=(0,h.Ay)("GET",(0,f.H3)(S)).then(z);return a.loadUsersForRole.promise(T),T},loadRolesForUser(u,{page:t,perPage:n,query:r}){const m=P(p.A.AuthzRolesController.loadRolesForUser,[u]),i=(0,y.A)(m,t,n,r),S=(0,h.Ay)("GET",(0,f.H3)(i)).then($);return a.loadRolesForUser.promise(S),S},loadRolesPaginated({page:u,perPage:t,query:n}){const r=P(p.A.AuthzRolesController.list),m=(0,y.A)(r,u,t,n),i=(0,h.Ay)("GET",(0,f.H3)(m)).then($);return a.loadRolesPaginated.promise(i),i}}))}}]);})();
//# sourceMappingURL=bb8c8232-4923.81d1d6eaec12319d4c0a.js.map
© 2015 - 2024 Weber Informatics LLC | Privacy Policy