web-interface.assets.1255d548-5199.051923e3e75d70e8884e.js Maven / Gradle / Ivy
"use strict";(()=>{(self.webpackChunkgraylog_web_interface=self.webpackChunkgraylog_web_interface||[]).push([["1255d548-5199"],{Lu0NTOJv:(F,T,a)=>{a.d(T,{Z:()=>h});var e=a("KOKBnITH"),O=a("lDGobrly");const A=(0,O.Z)({action:e.p.load,error:(i,l)=>({message:`Loading role with id "${l}" failed with status: ${i}`}),notFoundRedirect:!0}),d=(0,O.Z)({action:e.p.delete,success:(i,l)=>({message:`Role "${l}" was deleted successfully`}),error:(i,l,E)=>({message:`Deleting role "${E}" failed with status: ${i}`})}),P=(0,O.Z)({action:e.p.addMembers,success:(i,l)=>({message:`Users:"${l.join(", ")}" were assigned successfully`}),error:(i,l,E)=>({message:`Assigning users "${E.join(", ")}" failed with status: ${i}`})}),s=(0,O.Z)({action:e.p.removeMember,success:(i,l)=>({message:`User "${l}" was unassigned successfully`}),error:(i,l,E)=>({message:`Unassign user "${E}" failed with status: ${i}`})}),o=(0,O.Z)({action:e.p.loadUsersForRole,error:(i,l,E)=>({message:`Loading users for role "${E}" failed with status: ${i}`})}),m=(0,O.Z)({action:e.p.loadRolesForUser,error:(i,l)=>({message:`Loading roles for user "${l}" failed with status: ${i}`})}),f=(0,O.Z)({action:e.p.loadRolesPaginated,error:i=>({message:`Loading roles failed with status: ${i}`})}),h={load:A,delete:d,addMembers:P,removeMember:s,loadUsersForRole:o,loadRolesForUser:m,loadRolesPaginated:f}},"nmSm+aR9":(F,T,a)=>{a.d(T,{Z:()=>A});var e=a("VPaD/Np4"),O=a.n(e);class A{constructor(s,o,m,f,h,i,l,E,w,b,y,U,u,t,n){this._value={id:s,username:o,fullName:m,email:f,roles:h,readOnly:i,external:l,sessionActive:E,clientAddress:w,lastActivity:b,enabled:y,authServiceId:U,authServiceUid:u,authServiceEnabled:t,accountStatus:n}}get id(){return this._value.id}get username(){return this._value.username}get name(){return this._value.username}get fullName(){return this._value.fullName}get description(){return this._value.fullName}get email(){return this._value.email}get roles(){return this._value.roles}get readOnly(){return this._value.readOnly}get external(){return this._value.external}get sessionActive(){return this._value.sessionActive}get clientAddress(){return this._value.clientAddress}get lastActivity(){return this._value.lastActivity}get enabled(){return this._value.enabled}get authServiceId(){return this._value.authServiceId}get authServiceUid(){return this._value.authServiceUid}get authServiceEnabled(){return this._value.authServiceEnabled}get accountStatus(){return this._value.accountStatus}toBuilder(){const{id:s,username:o,fullName:m,email:f,roles:h,readOnly:i,external:l,sessionActive:E,clientAddress:w,lastActivity:b,enabled:y,authServiceId:U,authServiceUid:u,authServiceEnabled:t,accountStatus:n}=this._value;return new d(e.Map({id:s,username:o,fullName:m,email:f,roles:h,readOnly:i,external:l,sessionActive:E,clientAddress:w,lastActivity:b,enabled:y,authServiceId:U,authServiceUid:u,authServiceEnabled:t,accountStatus:n}))}static create(s,o,m,f,h,i,l,E,w,b,y,U,u,t,n){return new A(s,o,m,f,h,i,l,E,w,b,y,U,u,t,n)}toJSON(){const{id:s,username:o,fullName:m,email:f,roles:h,readOnly:i,external:l,sessionActive:E,clientAddress:w,lastActivity:b,enabled:y,authServiceId:U,authServiceUid:u,authServiceEnabled:t,accountStatus:n}=this._value;return{id:s,username:o,full_name:m,email:f,roles:h.toArray(),read_only:i,external_user:l,session_active:E,client_address:w,last_activity:b,enabled:y,auth_service_id:U,auth_service_uid:u,auth_service_enabled:t,account_status:n}}static fromJSON(s){const{id:o,username:m,full_name:f,email:h,roles:i,read_only:l,external_user:E,session_active:w,client_address:b,last_activity:y,enabled:U,auth_service_id:u,auth_service_uid:t,auth_service_enabled:n,account_status:c}=s;return A.create(o,m,f,h,e.Set(i),l!=null?l:!1,E!=null?E:!1,w!=null?w:!1,b,y,U,u,t,n,c)}static builder(){return new d}}class d{constructor(s=e.Map()){this.value=s}id(s){return new d(this.value.set("id",s))}username(s){return new d(this.value.set("username",s))}fullName(s){return new d(this.value.set("fullName",s))}email(s){return new d(this.value.set("email",s))}roles(s){return new d(this.value.set("roles",s))}readOnly(s){return new d(this.value.set("readOnly",s))}external(s){return new d(this.value.set("external",s))}sessionActive(s){return new d(this.value.set("sessionActive",s))}clientAddress(s){return new d(this.value.set("clientAddress",s))}lastActivity(s){return new d(this.value.set("lastActivity",s))}enabled(s){return new d(this.value.set("enabled",s))}authServiceId(s){return new d(this.value.set("authServiceId",s))}authServiceUid(s){return new d(this.value.set("authServiceUid",s))}authServiceEnabled(s){return new d(this.value.set("authServiceEnabled",s))}accountStatus(s){return new d(this.value.set("accountStatus",s))}build(){const{id:s,username:o,fullName:m,email:f,roles:h,readOnly:i,external:l,sessionActive:E,clientAddress:w,lastActivity:b,enabled:y,authServiceId:U,authServiceUid:u,authServiceEnabled:t,accountStatus:n}=this.value.toObject();return new A(s,o,m,f,h,i,l,E,w,b,y,U,u,t,n)}}},"7f/pGhgG":(F,T,a)=>{a.r(T),a.d(T,{default:()=>q});var e=a("Z7aTuO5B"),O=a("ty2gyrHp"),A=a("J6y4/h8P"),d=a("QL8i6bcz"),P=a("Lu0NTOJv"),s=a("KOKBnITH"),o=a("/GOzvPf6"),m=a("uZqmR+ju"),f=a("rVdVsuGH"),h=a("VPaD/Np4"),i=a("d4kzUuQm");const l=A.default.div`
display: flex;
justify-content: flex-end;
`,E=(r,v,S)=>{let g=`Do you really want to delete role "${v}"?`;const C={page:1,perPage:1,query:""};S(!0),P.Z.loadUsersForRole(r,v,C).then(I=>{I.pagination.total>=1&&(g+=`
It is still assigned to ${I.pagination.total} users.`),window.confirm(g)?P.Z.delete(r,v).then(()=>{S(!1)}):S(!1)})},b=({roleId:r,roleName:v,readOnly:S})=>{const[g,C]=(0,e.useState)(!1);return e.createElement("td",null,e.createElement(l,null,e.createElement(o.AE,{permissions:[`roles:edit:${v}`]},e.createElement(O.J,{to:i.ZP.SYSTEM.AUTHZROLES.edit(encodeURIComponent(r))},e.createElement(m.Button,{id:`edit-role-${r}`,bsSize:"xs",title:`Edit role ${v}`,type:"button"},"Edit"))),!S&&e.createElement(o.AE,{permissions:[`roles:delete:${v}`]},e.createElement(e.Fragment,null,"\xA0",e.createElement(m.Button,{id:`delete-role-${r}`,bsStyle:"danger",bsSize:"xs",title:`Delete role ${v}`,onClick:()=>E(r,v,C),type:"button"},g?e.createElement(o.$j,{text:"Deleting",delay:0}):"Delete")))))},y=10,u=({users:r=h.Set()})=>{const v=r.size,S=r.take(y).toArray().map(({id:g,username:C},I)=>e.createElement(o.AE,{permissions:[`users:read:${C}`],key:g},e.createElement(e.Fragment,null,e.createElement(O.r,{to:i.ZP.SYSTEM.USERS.show(g)},C),Iy&&S.push(e.createElement("span",{key:"dots"},"...")),e.createElement("td",null,e.createElement(o.Z2,null,r.size)," ",S)},t=A.default.td`
max-width: 300px;
`,c=({role:{id:r,name:v,description:S,readOnly:g},users:C})=>e.createElement("tr",{key:r},e.createElement("td",{className:"limited"},e.createElement(O.r,{to:i.ZP.SYSTEM.AUTHZROLES.show(r)},v)),e.createElement(t,null,e.createElement(o.iI,null,S)),e.createElement(u,{users:h.Set(C)}),e.createElement(b,{roleId:r,roleName:v,readOnly:g})),p=e.createElement(m.Popover,{id:"role-search-query-help",title:"Search Syntax Help"},e.createElement("p",null,e.createElement("strong",null,"Available search fields")),e.createElement(m.Table,{condensed:!0},e.createElement("thead",null,e.createElement("tr",null,e.createElement("th",null,"Field"),e.createElement("th",null,"Description"))),e.createElement("tbody",null,e.createElement("tr",null,e.createElement("td",null,"name"),e.createElement("td",null,"The name of a role")),e.createElement("tr",null,e.createElement("td",null,"description"),e.createElement("td",null,"The description of a role")))),e.createElement("p",null,e.createElement("strong",null,"Examples")),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))),Z=()=>e.createElement(o.Ox,{trigger:"click",rootClose:!0,placement:"right",overlay:p},e.createElement(m.Button,{bsStyle:"link"},e.createElement(o.JO,{name:"question-circle"}))),M=A.default.div`
margin-bottom: 10px;
`,G=({onSearch:r})=>e.createElement(M,null,e.createElement(o.UI,{onSearch:r,onReset:()=>r(""),queryHelpComponent:e.createElement(Z,null),topMargin:0})),K=["Name","Description","Users","Actions"],Q=A.default.div`
.data-table {
overflow-x: visible;
}
`,j=A.default.div`
display: flex;
align-items: center;
`,W=(0,A.default)(o.$j)(({theme:r})=>`
margin-left: 10px;
font-size: ${r.fonts.size.h3};
`),V=(0,A.default)(o.l9)`
.pagination {
margin: 0;
}
`,Y=r=>{switch(r.toLowerCase()){case"actions":return e.createElement("th",{className:"actions text-right"},r);default:return e.createElement("th",null,r)}},N=(r,v,S)=>{v(!0),P.Z.loadRolesPaginated(r).then(g=>{S(g),v(!1)})},B=(r,v,S,g)=>s.p.delete.completed.listen(()=>{N(r,v,S),g()}),X=()=>{var r;const v=()=>({loading:!1,users:[]}),S=d.G.exports("teams");return((r=S==null?void 0:S[0])==null?void 0:r.useTeamMembersByRole)||v},_=()=>{const{page:r,pageSize:v,resetPage:S}=(0,f.ZP)(),[g,C]=(0,e.useState)(),[I,H]=(0,e.useState)(!1),[D,ee]=(0,e.useState)(""),{list:te}=g||{},$=X()();(0,e.useEffect)(()=>N({page:r,perPage:v,query:D},H,C),[r,v,D]),(0,e.useEffect)(()=>B({page:r,perPage:v,query:D},H,C,S),[r,v,D,S]);const se=x=>{S(),ee(x)},ne=(0,e.useCallback)(x=>{var J;const{id:L}=x,re=g==null?void 0:g.context.users[L],ae=$.users[L]?[...$.users[L],...re]:(J=g==null?void 0:g.context)==null?void 0:J.users[L];return e.createElement(c,{role:x,users:ae})},[$,g==null?void 0:g.context]);if(!g)return e.createElement(o.$j,null);const le=e.createElement(G,{onSearch:se});return e.createElement(Q,null,e.createElement(m.Row,{className:"content"},e.createElement(m.Col,{xs:12},e.createElement(j,null,e.createElement("h2",null,"Roles"),I&&e.createElement(W,{text:"",delay:0})),e.createElement("p",{className:"description"},"Found ",g.pagination.total," roles on the system."),e.createElement(V,{totalItems:g.pagination.total},e.createElement(o.wQ,{id:"roles-overview",className:"table-hover",rowClassName:"no-bm",headers:K,headerCellFormatter:Y,sortByKey:"name",rows:te.toJS(),noDataText:e.createElement(o.pJ,null,"No roles have been found."),customFilter:le,dataRowFormatter:ne,filterKeys:[],filterLabel:"Filter Roles"})))))};var z=a("E+CaPsQD"),k=a("7dh0vSOR");const q=()=>e.createElement(o.$4,{title:"Roles Overview"},e.createElement(o.mr,{title:"Roles Overview",documentationLink:{title:"Permissions documentation",path:z.Z.PAGES.USERS_ROLES},topActions:e.createElement(O.J,{to:i.ZP.SYSTEM.AUTHZROLES.OVERVIEW},e.createElement(m.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(m.Row,{className:"content"},e.createElement(m.Col,{xs:12},e.createElement(m.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(o.JO,{name:"user-plus"})," 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.Z,{page:z.Z.PAGES.PERMISSIONS,text:"documentation"}),"."))),e.createElement(_,null))},KOKBnITH:(F,T,a)=>{a.d(T,{p:()=>l});var e=a("JnTtTRmZ"),O=a.n(e),A=a("VPaD/Np4"),d=a("eFxcQyPT"),P=a("U1Iufsob"),s=a("MdYBRjRJ"),o=a("IA3Ku5lS"),m=a("gyRmhZSW");class f{constructor(t,n,c,p,R){this._value={id:t,name:n,description:c,permissions:p,readOnly:R}}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:c,permissions:p,readOnly:R}=this._value;return new h(A.Map({id:t,name:n,description:c,permissions:p,readOnly:R}))}static create(t,n,c,p,R){return new f(t,n,c,p,R)}toJSON(){const{id:t,name:n,description:c,permissions:p,readOnly:R}=this._value;return{id:t,name:n,description:c,permissions:p,read_only:R}}static fromJSON(t){const{id:n,name:c,description:p,permissions:R,read_only:Z}=t;return f.create(n,c,p,R,Z)}static builder(){return new h}}class h{constructor(t=A.Map()){this.value=t}id(t){return new h(this.value.set("id",t))}name(t){return new h(this.value.set("name",t))}description(t){return new h(this.value.set("description",t))}permissions(t){return new h(this.value.set("permissions",t))}readOnly(t){return new h(this.value.set("readOnly",t))}build(){const{id:t,name:n,description:c,permissions:p,readOnly:R}=this.value.toObject();return new f(t,n,c,p,R)}}const l=(0,o.ei)("AuthzRoles",()=>O().createActions({load:{asyncResult:!0},delete:{asyncResult:!0},addMembers:{asyncResult:!0},removeMember:{asyncResult:!0},loadUsersForRole:{asyncResult:!0},loadRolesForUser:{asyncResult:!0},loadRolesPaginated:{asyncResult:!0}}));var E=a("nmSm+aR9");const w=({count:u,total:t,page:n,per_page:c,query:p,roles:R=[],context:Z={users:void 0}})=>({list:A.List(R.map(M=>f.fromJSON(M))),pagination:{query:p,page:n,perPage:c,count:u,total:t},context:Z}),b=({count:u,total:t,page:n,per_page:c,query:p,users:R})=>({list:A.List(R.map(Z=>E.Z.fromJSON(Z))),pagination:{page:n,perPage:c,query:p,count:u,total:t}}),y=(u,t=[])=>{const n=t.map(c=>encodeURIComponent(c));return u(...n).url},U=(0,o.dS)("AuthzRoles",()=>O().createStore({listenables:[l],load(u){const t=(0,s.DC)(y(P.Z.AuthzRolesController.load,[u])),n=(0,d.ZP)("GET",t).then(f.fromJSON);return l.load.promise(n),n},delete(u){const t=(0,s.DC)(y(P.Z.AuthzRolesController.delete,[u])),n=(0,d.ZP)("DELETE",t);return l.delete.promise(n),n},addMembers(u,t){const n=y(P.Z.AuthzRolesController.addMembers,[u]),c=(0,d.ZP)("PUT",(0,s.DC)(n),t.toArray());return l.addMembers.promise(c),c},removeMember(u,t){const n=y(P.Z.AuthzRolesController.removeMember,[u,t]),c=(0,d.ZP)("DELETE",(0,s.DC)(n));return l.removeMember.promise(c),c},loadUsersForRole(u,t,{page:n,perPage:c,query:p}){const R=y(P.Z.AuthzRolesController.loadUsersForRole,[u]),Z=(0,m.Z)(R,n,c,p),M=(0,d.ZP)("GET",(0,s.DC)(Z)).then(b);return l.loadUsersForRole.promise(M),M},loadRolesForUser(u,{page:t,perPage:n,query:c}){const p=y(P.Z.AuthzRolesController.loadRolesForUser,[u]),R=(0,m.Z)(p,t,n,c),Z=(0,d.ZP)("GET",(0,s.DC)(R)).then(w);return l.loadRolesForUser.promise(Z),Z},loadRolesPaginated({page:u,perPage:t,query:n}){const c=y(P.Z.AuthzRolesController.list),p=(0,m.Z)(c,u,t,n),R=(0,d.ZP)("GET",(0,s.DC)(p)).then(w);return l.loadRolesPaginated.promise(R),R}}))}}]);})();
//# sourceMappingURL=1255d548-5199.051923e3e75d70e8884e.js.map
© 2015 - 2024 Weber Informatics LLC | Privacy Policy