@tachybase/module-acl 1.0.6 → 1.0.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/index.js +2 -2
- package/dist/externalVersion.js +10 -10
- package/package.json +11 -11
package/dist/client/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(v,l){typeof exports=="object"&&typeof module!="undefined"?l(exports,require("@tachybase/client"),require("@tachybase/utils/client"),require("react/jsx-runtime"),require("react"),require("@tachybase/schema"),require("antd"),require("react-i18next"),require("ahooks"),require("lodash"),require("@ant-design/icons")):typeof define=="function"&&define.amd?define(["exports","@tachybase/client","@tachybase/utils/client","react/jsx-runtime","react","@tachybase/schema","antd","react-i18next","ahooks","lodash","@ant-design/icons"],l):(v=typeof globalThis!="undefined"?globalThis:v||self,l(v["@tachybase/module-acl"]={},v["@tachybase/client"],v["@tachybase/utils"],v.jsxRuntime,v.react,v["@tachybase/schema"],v.antd,v["react-i18next"],v.ahooks,v.lodash,v["@ant-design/icons"]))})(this,function(v,l,x,s,h,S,p,M,T,N,de){"use strict";var
|
|
1
|
+
(function(v,l){typeof exports=="object"&&typeof module!="undefined"?l(exports,require("@tachybase/client"),require("@tachybase/utils/client"),require("react/jsx-runtime"),require("react"),require("@tachybase/schema"),require("antd"),require("react-i18next"),require("ahooks"),require("lodash"),require("@ant-design/icons")):typeof define=="function"&&define.amd?define(["exports","@tachybase/client","@tachybase/utils/client","react/jsx-runtime","react","@tachybase/schema","antd","react-i18next","ahooks","lodash","@ant-design/icons"],l):(v=typeof globalThis!="undefined"?globalThis:v||self,l(v["@tachybase/module-acl"]={},v["@tachybase/client"],v["@tachybase/utils"],v.jsxRuntime,v.react,v["@tachybase/schema"],v.antd,v["react-i18next"],v.ahooks,v.lodash,v["@ant-design/icons"]))})(this,function(v,l,x,s,h,S,p,M,T,N,de){"use strict";var xi=Object.defineProperty,Si=Object.defineProperties;var $i=Object.getOwnPropertyDescriptors;var Je=Object.getOwnPropertySymbols;var wi=Object.prototype.hasOwnProperty,Ai=Object.prototype.propertyIsEnumerable;var Ze=(v,l,x)=>l in v?xi(v,l,{enumerable:!0,configurable:!0,writable:!0,value:x}):v[l]=x,I=(v,l)=>{for(var x in l||(l={}))wi.call(l,x)&&Ze(v,x,l[x]);if(Je)for(var x of Je(l))Ai.call(l,x)&&Ze(v,x,l[x]);return v},k=(v,l)=>Si(v,$i(l));var A=(v,l,x)=>new Promise((s,h)=>{var S=T=>{try{M(x.next(T))}catch(N){h(N)}},p=T=>{try{M(x.throw(T))}catch(N){h(N)}},M=T=>T.done?s(T.value):Promise.resolve(T.value).then(S,p);M((x=x.apply(v,l)).next())});class Qe{constructor(){this.rolesManager=new x.Registry}add(t,r){this.rolesManager.register(t,r)}list(){return this.rolesManager.getEntities()}}function H(){return M.useTranslation(["@tachybase/module-acl","core"],{nsMode:"fallback"})}const Re=()=>{const{t:e}=H();return s.jsx(l.SchemaComponent,{scope:{t:e},schema:{type:"void",properties:{newRole:{type:"void",title:e("New role"),"x-component":"Action","x-component-props":{type:"text",icon:"PlusOutlined",style:{width:"100%",textAlign:"left"}},properties:{drawer:{type:"void","x-component":"Action.Drawer","x-decorator":"Form","x-decorator-props":{useValues(t){const r=l.useActionContext();return l.useRequest(()=>Promise.resolve({data:{name:`r_${S.uid()}`,snippets:["!ui.*","!pm","!pm.*"]}}),k(I({},t),{refreshDeps:[r.visible]}))}},title:e("New role"),properties:{title:{"x-component":"CollectionField","x-decorator":"FormItem"},name:{"x-component":"CollectionField","x-decorator":"FormItem",description:'{{t("Randomly generated and can be modified. Support letters, numbers and underscores, must start with an letter.")}}'},default:{"x-component":"CollectionField","x-decorator":"FormItem",title:"","x-content":'{{t("Default role")}}'},footer:{type:"void","x-component":"Action.Drawer.Footer",properties:{cancel:{title:'{{t("Cancel")}}',"x-component":"Action","x-component-props":{useAction:"{{ cm.useCancelAction }}"}},submit:{title:'{{t("Submit")}}',"x-component":"Action","x-component-props":{type:"primary",useAction:"{{ cm.useCreateAction }}"}}}}}}}}}}})},D=h.createContext({role:null});D.displayName="RolesManagerContext";const R=h.createContext([]);R.displayName="AvailableActionsContext";const et=e=>{const{data:t,loading:r}=l.useRequest({resource:"availableActions",action:"list"});return r?s.jsx(p.Spin,{}):s.jsx(R.Provider,{value:t==null?void 0:t.data,children:e.children})},tt=()=>h.useContext(R);var K=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{};function he(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var rt=typeof K=="object"&&K&&K.Object===Object&&K,nt=rt,at=nt,st=typeof self=="object"&&self&&self.Object===Object&&self,ot=at||st||Function("return this")(),L=ot,it=L,ct=it.Symbol,V=ct,fe=V,ve=Object.prototype,lt=ve.hasOwnProperty,ut=ve.toString,z=fe?fe.toStringTag:void 0;function pt(e){var t=lt.call(e,z),r=e[z];try{e[z]=void 0;var n=!0}catch(i){}var a=ut.call(e);return n&&(t?e[z]=r:delete e[z]),a}var dt=pt,ht=Object.prototype,ft=ht.toString;function vt(e){return ft.call(e)}var gt=vt,ge=V,mt=dt,yt=gt,bt="[object Null]",_t="[object Undefined]",me=ge?ge.toStringTag:void 0;function Ct(e){return e==null?e===void 0?_t:bt:me&&me in Object(e)?mt(e):yt(e)}var ee=Ct;function xt(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var te=xt,St=ee,$t=te,wt="[object AsyncFunction]",At="[object Function]",Pt="[object GeneratorFunction]",It="[object Proxy]";function Tt(e){if(!$t(e))return!1;var t=St(e);return t==At||t==Pt||t==wt||t==It}var Ot=Tt,Mt=L,Ft=Mt["__core-js_shared__"],Et=Ft,re=Et,ye=function(){var e=/[^.]+$/.exec(re&&re.keys&&re.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function Dt(e){return!!ye&&ye in e}var Nt=Dt,kt=Function.prototype,Ht=kt.toString;function jt(e){if(e!=null){try{return Ht.call(e)}catch(t){}try{return e+""}catch(t){}}return""}var qt=jt,Gt=Ot,zt=Nt,Ut=te,Kt=qt,Lt=/[\\^$.*+?()[\]{}|]/g,Vt=/^\[object .+?Constructor\]$/,Wt=Function.prototype,Bt=Object.prototype,Xt=Wt.toString,Yt=Bt.hasOwnProperty,Jt=RegExp("^"+Xt.call(Yt).replace(Lt,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Zt(e){if(!Ut(e)||zt(e))return!1;var t=Gt(e)?Jt:Vt;return t.test(Kt(e))}var Qt=Zt;function Rt(e,t){return e==null?void 0:e[t]}var er=Rt,tr=Qt,rr=er;function nr(e,t){var r=rr(e,t);return tr(r)?r:void 0}var W=nr,ar=W,sr=ar(Object,"create"),B=sr,be=B;function or(){this.__data__=be?be(null):{},this.size=0}var ir=or;function cr(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var lr=cr,ur=B,pr="__lodash_hash_undefined__",dr=Object.prototype,hr=dr.hasOwnProperty;function fr(e){var t=this.__data__;if(ur){var r=t[e];return r===pr?void 0:r}return hr.call(t,e)?t[e]:void 0}var vr=fr,gr=B,mr=Object.prototype,yr=mr.hasOwnProperty;function br(e){var t=this.__data__;return gr?t[e]!==void 0:yr.call(t,e)}var _r=br,Cr=B,xr="__lodash_hash_undefined__";function Sr(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=Cr&&t===void 0?xr:t,this}var $r=Sr,wr=ir,Ar=lr,Pr=vr,Ir=_r,Tr=$r;function j(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}j.prototype.clear=wr,j.prototype.delete=Ar,j.prototype.get=Pr,j.prototype.has=Ir,j.prototype.set=Tr;var Or=j;function Mr(){this.__data__=[],this.size=0}var Fr=Mr;function Er(e,t){return e===t||e!==e&&t!==t}var _e=Er,Dr=_e;function Nr(e,t){for(var r=e.length;r--;)if(Dr(e[r][0],t))return r;return-1}var X=Nr,kr=X,Hr=Array.prototype,jr=Hr.splice;function qr(e){var t=this.__data__,r=kr(t,e);if(r<0)return!1;var n=t.length-1;return r==n?t.pop():jr.call(t,r,1),--this.size,!0}var Gr=qr,zr=X;function Ur(e){var t=this.__data__,r=zr(t,e);return r<0?void 0:t[r][1]}var Kr=Ur,Lr=X;function Vr(e){return Lr(this.__data__,e)>-1}var Wr=Vr,Br=X;function Xr(e,t){var r=this.__data__,n=Br(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}var Yr=Xr,Jr=Fr,Zr=Gr,Qr=Kr,Rr=Wr,en=Yr;function q(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}q.prototype.clear=Jr,q.prototype.delete=Zr,q.prototype.get=Qr,q.prototype.has=Rr,q.prototype.set=en;var tn=q,rn=W,nn=L,an=rn(nn,"Map"),sn=an,Ce=Or,on=tn,cn=sn;function ln(){this.size=0,this.__data__={hash:new Ce,map:new(cn||on),string:new Ce}}var un=ln;function pn(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}var dn=pn,hn=dn;function fn(e,t){var r=e.__data__;return hn(t)?r[typeof t=="string"?"string":"hash"]:r.map}var Y=fn,vn=Y;function gn(e){var t=vn(this,e).delete(e);return this.size-=t?1:0,t}var mn=gn,yn=Y;function bn(e){return yn(this,e).get(e)}var _n=bn,Cn=Y;function xn(e){return Cn(this,e).has(e)}var Sn=xn,$n=Y;function wn(e,t){var r=$n(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this}var An=wn,Pn=un,In=mn,Tn=_n,On=Sn,Mn=An;function G(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}G.prototype.clear=Pn,G.prototype.delete=In,G.prototype.get=Tn,G.prototype.has=On,G.prototype.set=Mn;var xe=G,Fn="__lodash_hash_undefined__";function En(e){return this.__data__.set(e,Fn),this}var Dn=En;function Nn(e){return this.__data__.has(e)}var kn=Nn,Hn=xe,jn=Dn,qn=kn;function J(e){var t=-1,r=e==null?0:e.length;for(this.__data__=new Hn;++t<r;)this.add(e[t])}J.prototype.add=J.prototype.push=jn,J.prototype.has=qn;var Gn=J;function zn(e,t,r,n){for(var a=e.length,i=r+(n?1:-1);n?i--:++i<a;)if(t(e[i],i,e))return i;return-1}var Un=zn;function Kn(e){return e!==e}var Ln=Kn;function Vn(e,t,r){for(var n=r-1,a=e.length;++n<a;)if(e[n]===t)return n;return-1}var Wn=Vn,Bn=Un,Xn=Ln,Yn=Wn;function Jn(e,t,r){return t===t?Yn(e,t,r):Bn(e,Xn,r)}var Zn=Jn,Qn=Zn;function Rn(e,t){var r=e==null?0:e.length;return!!r&&Qn(e,t,0)>-1}var ea=Rn;function ta(e,t,r){for(var n=-1,a=e==null?0:e.length;++n<a;)if(r(t,e[n]))return!0;return!1}var ra=ta;function na(e,t){return e.has(t)}var aa=na,sa=W,oa=L,ia=sa(oa,"Set"),ca=ia;function la(){}var ua=la;function pa(e){var t=-1,r=Array(e.size);return e.forEach(function(n){r[++t]=n}),r}var Se=pa,ne=ca,da=ua,ha=Se,fa=1/0,va=ne&&1/ha(new ne([,-0]))[1]==fa?function(e){return new ne(e)}:da,ga=va,ma=Gn,ya=ea,ba=ra,_a=aa,Ca=ga,xa=Se,Sa=200;function $a(e,t,r){var n=-1,a=ya,i=e.length,o=!0,c=[],u=c;if(r)o=!1,a=ba;else if(i>=Sa){var d=t?null:Ca(e);if(d)return xa(d);o=!1,a=_a,u=new ma}else u=t?[]:c;e:for(;++n<i;){var y=e[n],C=t?t(y):y;if(y=r||y!==0?y:0,o&&C===C){for(var _=u.length;_--;)if(u[_]===C)continue e;t&&u.push(C),c.push(y)}else a(u,C,r)||(u!==c&&u.push(C),c.push(y))}return c}var wa=$a,Aa=wa;function Pa(e){return e&&e.length?Aa(e):[]}var Ia=Pa;const Ta=he(Ia),$e=l.createStyles(({css:e})=>e`
|
|
2
2
|
.ant-table-cell {
|
|
3
3
|
> .ant-space-horizontal {
|
|
4
4
|
.ant-space-item-split:has(+ .ant-space-item:empty) {
|
|
@@ -6,4 +6,4 @@
|
|
|
6
6
|
}
|
|
7
7
|
}
|
|
8
8
|
}
|
|
9
|
-
`),we=(e=[],t=[])=>{for(const r of e)t.push(r.aclSnippet),r.children&&r.children.length&&we(r.children,t);return t},Oa=({active:e})=>{const t=l.useApp(),{styles:r}=$e(),{role:n}=h.useContext(D),a=l.useAPIClient(),i=l.useCompile(),o=t.systemSettingsManager.getList(!1),c=t.systemSettingsManager.getAclSnippets(),[u,d]=h.useState((n==null?void 0:n.snippets)||[]),y=h.useMemo(()=>N.flatMap(o,g=>g.children?[g,...g.children]:g),[o]),C=h.useMemo(()=>u.includes("pm.*")&&u.every(g=>!g.startsWith("!pm.")),[u]),{t:_}=M.useTranslation(),{loading:w,refresh:P}=l.useRequest({resource:"roles.snippets",resourceOf:n==null?void 0:n.name,action:"list",params:{paginate:!1}},{ready:!!n&&e,refreshDeps:[n==null?void 0:n.name],manual:!0,onSuccess(g){d((g==null?void 0:g.data.filter(m=>y.find(f=>m.includes(`!${f.aclSnippet}`)||!m.startsWith("!pm."))))||[])}});if(!n)return;const $=a.resource("roles.snippets",n==null?void 0:n.name),O=(g,m)=>A(this,null,function*(){const b=we(m==null?void 0:m.children,[]).concat(m.aclSnippet);g?(yield $.add({values:b.map(F=>"!"+F)}),P()):(yield $.remove({values:b.map(F=>"!"+F)}),P()),p.message.success(_("Saved successfully"))});return s.jsx(p.Table,{className:r,loading:w,rowKey:"key",pagination:!1,expandable:{defaultExpandAllRows:!0},columns:[{dataIndex:"title",title:_("Plugin name"),render:g=>i(g)},{dataIndex:"accessible",title:s.jsxs(s.Fragment,{children:[s.jsx(p.Checkbox,{checked:C,onChange:()=>A(this,null,function*(){const g=c.map(m=>"!"+m);C?yield $.add({values:g}):yield $.remove({values:g}),P(),p.message.success(_("Saved successfully"))})}),_("Accessible")]}),render:(g,m)=>{const f=!u.includes("!"+m.aclSnippet);return s.jsx(p.Checkbox,{checked:f,onChange:()=>O(f,m)})}}],dataSource:o.filter(g=>g.isTopLevel!==!1).map(g=>g.showTabs!==!1?g:N.omit(g,"children"))})},Ma=e=>{var r;if(!e)return{};const t={};return(r=e==null?void 0:e.forEach)==null||r.call(e,n=>{const[a,i]=n.split(":");t[a]=i||"all"}),t},Ae=e=>{const t=[];for(const r in e)if(Object.prototype.hasOwnProperty.call(e,r)){const n=e[r];n==="all"?t.push(r):t.push(`${r}:${n}`)}return t},Fa=S.connect(e=>{const{onChange:t}=e,r=tt(),n=l.useCompile(),{t:a}=M.useTranslation(),i=S.useField(),o=Ma(i.value);return s.jsx("div",{children:s.jsx(p.Table,{rowKey:"name",size:"small",pagination:!1,columns:[{dataIndex:"displayName",title:a("Action display name"),render:c=>n(c)},{dataIndex:"onNewRecord",title:a("Action type"),render:c=>c?s.jsx(p.Tag,{color:"green",children:a("Action on new records")}):s.jsx(p.Tag,{color:"geekblue",children:a("Action on existing records")})},{dataIndex:"enabled",title:a("Allow"),render:(c,u)=>s.jsx(p.Checkbox,{checked:c,"aria-label":`${u.name}_checkbox`,onChange:d=>{c?delete o[u.name]:o[u.name]="all",t(Ae(o))}})},{dataIndex:"scope",title:a("Data scope"),render:(c,u)=>!u.onNewRecord&&s.jsx(p.Select,{"data-testid":"select-data-scope",popupMatchSelectWidth:!1,size:"small",value:c,options:[{label:a("All records"),value:"all"},{label:a("Own records"),value:"own"}],onChange:d=>{o[u.name]=d,t(Ae(o))}})}],dataSource:r==null?void 0:r.map(c=>{let u="all",d=!1;return o[c.name]&&(d=!0,u=o[c.name]),k(I({},c),{enabled:d,scope:u})})})})}),Ea=S.connect(e=>{const{t}=M.useTranslation();return s.jsxs(p.Checkbox.Group,{style:{width:"100%",display:"block"},value:e.value,onChange:r=>{const n=["ui.*","pm","pm.*","app"],a=n.map(o=>`!${o}`),i=Ta([...e.value||[],...r]).filter(o=>o&&!a.includes(o)).map(o=>!n.includes(o)||r!=null&&r.includes(o)?o:`!${o}`);for(const o of n)!i.includes(o)&&!i.includes(`!${o}`)&&i.push(`!${o}`);e.onChange(i)},children:[s.jsx("div",{style:{marginTop:16},children:s.jsx(p.Checkbox,{value:"ui.*",children:t("Allows to configure interface")})}),s.jsx("div",{style:{marginTop:8},children:s.jsx(p.Checkbox,{value:"pm",children:t("Allows to install, activate, disable plugins")})}),s.jsx("div",{style:{marginTop:8},children:s.jsx(p.Checkbox,{value:"pm.*",children:t("Allows to configure plugins")})}),s.jsx("div",{style:{marginTop:8},children:s.jsx(p.Checkbox,{value:"app",children:t("Allows to clear cache, reboot application")})})]})}),Da=({active:e})=>{var u;const{role:t,setRole:r}=h.useContext(D),{t:n}=H(),a=l.useAPIClient(),i=(u=t==null?void 0:t.snippets)==null?void 0:u.includes("pm.*"),o=T.useMemoizedFn(d=>A(this,null,function*(){yield a.resource("roles").update({filterByTk:t.name,values:d.values}),r(I(I({},t),d.values)),p.message.success(n("Saved successfully"))})),c=h.useMemo(()=>S.createForm({values:t,effects(){S.onFormValuesChange(d=>A(this,null,function*(){yield o(d)}))}}),[t,o]);return s.jsx(l.SchemaComponent,{components:{SnippetCheckboxGroup:Ea,StrategyActions:Fa,PluginPermissions:Oa},scope:{pm:i},schema:{type:"void",name:S.uid(),"x-component":"div",properties:{general:{"x-component":"FormV2","x-component-props":{form:c},properties:{snippets:{title:n("Configure permissions"),type:"boolean","x-decorator":"FormItem","x-component":"SnippetCheckboxGroup"}}},plugins:{"x-component":"FormV2",properties:{pluginSettings:{title:n("Plugin settings"),"x-decorator":"FormItem","x-component":"PluginPermissions","x-visible":"{{pm}}"}}}}}})},ae=h.createContext(null);ae.displayName="MenuItemsContext";const Pe=(e={})=>{const t=[];for(const r in e)if(Object.prototype.hasOwnProperty.call(e,r)){const n=e[r],a={title:n.title,uid:n["x-uid"]};n.properties&&(a.children=Pe(n.properties)),t.push(a)}return t},Na=()=>h.useContext(ae),Ie=e=>{var i,o;const r={url:`uiSchemas:getProperties/${l.useAdminSchemaUid()}`},n=l.useRequest(r);if(n.loading)return s.jsx(p.Spin,{});const a=Pe((o=(i=n.data)==null?void 0:i.data)==null?void 0:o.properties);return s.jsx(ae.Provider,{value:{service:n,items:a},children:e.children})},Te=e=>{if(!Array.isArray(e))return[];const t=[];for(const r of e)t.push(r.uid),t.push(...Te(r.children));return t},Oe=(e,t,r=[])=>{if(!e)return[];for(const n of e){if(r.push(n.uid),t(n))return r;if(n.children){const a=Oe(n.children,t,r);if(a.length)return a}r.pop()}return[]},Me=(e=[],t=[])=>{for(const r of e)t.push(r.uid),r.children&&r.children.length&&Me(r.children,t);return t},ka=({active:e})=>{const{styles:t}=$e(),{role:r,setRole:n}=h.useContext(D),a=l.useAPIClient(),{items:i}=Na(),{t:o}=M.useTranslation(),c=Te(i),[u,d]=h.useState([]),{loading:y,refresh:C}=l.useRequest({resource:"roles.menuUiSchemas",resourceOf:r.name,action:"list",params:{paginate:!1}},{ready:!!r&&e,refreshDeps:[r==null?void 0:r.name],onSuccess(m){var f;d(((f=m==null?void 0:m.data)==null?void 0:f.map(b=>b["x-uid"]))||[])}}),_=a.resource("roles.menuUiSchemas",r.name),w=c.length===u.length,P=(m,f)=>A(this,null,function*(){const b=Oe(i,E=>E.uid===f.uid),F=Me(f==null?void 0:f.children,[]);if(m){const E=F.concat(f.uid),pe=u.filter(Si=>!E.includes(Si));d([...pe]),yield _.remove({values:E})}else{const E=F.concat(b);d(pe=>N.uniq([...pe,...E])),yield _.add({values:E})}p.message.success(o("Saved successfully"))}),$=m=>m.map(f=>{const b=o(f.title);return f.children?k(I({},f),{title:b,children:$(f.children)}):k(I({},f),{title:b})}),O=T.useMemoizedFn(m=>A(this,null,function*(){yield a.resource("roles").update({filterByTk:r.name,values:m.values}),n(I(I({},r),m.values)),p.message.success(o("Saved successfully"))})),g=h.useMemo(()=>S.createForm({values:r,effects(){S.onFormValuesChange(m=>A(this,null,function*(){yield O(m)}))}}),[r,O]);return s.jsxs(s.Fragment,{children:[s.jsx(l.SchemaComponent,{schema:{type:"void",name:S.uid(),"x-component":"FormV2","x-component-props":{form:g},properties:{allowNewMenu:{title:o("Menu permissions"),"x-decorator":"FormItem","x-component":"Checkbox","x-content":o("New menu items are allowed to be accessed by default.")}}}}),s.jsx(p.Table,{className:t,loading:y,rowKey:"uid",pagination:!1,expandable:{defaultExpandAllRows:!0},columns:[{dataIndex:"title",title:o("Menu item title")},{dataIndex:"accessible",title:s.jsxs(s.Fragment,{children:[s.jsx(p.Checkbox,{checked:w,onChange:m=>A(this,null,function*(){w?yield _.set({values:[]}):yield _.set({values:c}),C(),p.message.success(o("Saved successfully"))})})," ",o("Accessible")]}),render:(m,f)=>{const b=u.includes(f.uid);return s.jsx(p.Checkbox,{checked:b,onChange:()=>P(b,f)})}}],dataSource:$(i)})]})},se=e=>s.jsx("div",{style:{maxHeight:"60vh",overflowY:"auto"},children:e.children}),Ha=({active:e})=>{var _;const{t}=H(),[r,n]=h.useState("general"),{role:a,setRole:i}=h.useContext(D),o=(_=a==null?void 0:a.snippets)==null?void 0:_.includes("pm.*"),u=l.useApp().getComponent("DataSourcePermissionManager"),d=h.useMemo(()=>[{key:"general",label:t("System"),children:s.jsx(se,{children:s.jsx(Da,{active:r==="general"&&e})})},{key:"menu",label:t("Menu"),children:s.jsx(se,{children:s.jsx(Ie,{children:s.jsx(ka,{active:r==="menu"&&e})})})},...u?[{key:"dataSource",label:t("Data sources"),children:s.jsx(se,{children:s.jsx(Ie,{children:s.jsx(u,{role:a,active:r==="dataSource"&&e})})})}]:[]],[o,r,e,t]),y=l.useAPIClient(),{data:C}=l.useRequest(()=>y.resource("roles").get({filterByTk:a==null?void 0:a.name}).then(w=>{var $,O;const P=($=w==null?void 0:w.data)==null?void 0:$.data;return(O=P.snippets)==null||O.forEach(g=>{P[g]=!0}),P}),{ready:e&&!!a,refreshDeps:[a==null?void 0:a.name]});return h.useEffect(()=>{n("general")},[a==null?void 0:a.name]),h.useEffect(()=>{i(C)},[C]),s.jsx(et,{children:s.jsx(p.Tabs,{type:"card",activeKey:r,onChange:w=>n(w),items:d})})},ja=({loadMore:e})=>{const[t,r]=h.useState(null),n=h.useRef(null),a=h.useCallback(i=>{i&&(n.current&&n.current.disconnect(),n.current=new IntersectionObserver(o=>{o.forEach(c=>{c.target===i.current&&c.isIntersecting&&(n.current&&n.current.unobserve(i.current),e())})}),i.current&&n.current&&n.current.observe(i.current))},[e]);return h.useEffect(()=>(a(t),()=>{n.current&&n.current.disconnect()}),[t,a]),{lastItem:t,setLastItem:r}};var qa=Array.isArray,U=qa;function Ga(e){return e!=null&&typeof e=="object"}var oe=Ga,za=ee,Ua=oe,Ka="[object Symbol]";function La(e){return typeof e=="symbol"||Ua(e)&&za(e)==Ka}var ie=La,Va=U,Wa=ie,Ba=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Ya=/^\w*$/;function Xa(e,t){if(Va(e))return!1;var r=typeof e;return r=="number"||r=="symbol"||r=="boolean"||e==null||Wa(e)?!0:Ya.test(e)||!Ba.test(e)||t!=null&&e in Object(t)}var Ja=Xa,Fe=xe,Za="Expected a function";function ce(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(Za);var r=function(){var n=arguments,a=t?t.apply(this,n):n[0],i=r.cache;if(i.has(a))return i.get(a);var o=e.apply(this,n);return r.cache=i.set(a,o)||i,o};return r.cache=new(ce.Cache||Fe),r}ce.Cache=Fe;var Qa=ce,Ra=Qa,es=500;function ts(e){var t=Ra(e,function(n){return r.size===es&&r.clear(),n}),r=t.cache;return t}var rs=ts,ns=rs,as=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ss=/\\(\\)?/g,os=ns(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(as,function(r,n,a,i){t.push(a?i.replace(ss,"$1"):n||r)}),t}),is=os;function cs(e,t){for(var r=-1,n=e==null?0:e.length,a=Array(n);++r<n;)a[r]=t(e[r],r,e);return a}var ls=cs,Ee=V,us=ls,ps=U,ds=ie,hs=1/0,De=Ee?Ee.prototype:void 0,Ne=De?De.toString:void 0;function ke(e){if(typeof e=="string")return e;if(ps(e))return us(e,ke)+"";if(ds(e))return Ne?Ne.call(e):"";var t=e+"";return t=="0"&&1/e==-hs?"-0":t}var fs=ke,vs=fs;function gs(e){return e==null?"":vs(e)}var ms=gs,ys=U,bs=Ja,_s=is,Cs=ms;function xs(e,t){return ys(e)?e:bs(e,t)?[e]:_s(Cs(e))}var Z=xs,Ss=ie,$s=1/0;function ws(e){if(typeof e=="string"||Ss(e))return e;var t=e+"";return t=="0"&&1/e==-$s?"-0":t}var le=ws,As=Z,Ps=le;function Is(e,t){t=As(t,e);for(var r=0,n=t.length;e!=null&&r<n;)e=e[Ps(t[r++])];return r&&r==n?e:void 0}var Ts=Is,Os=W,Ms=function(){try{var e=Os(Object,"defineProperty");return e({},"",{}),e}catch(t){}}(),He=Ms,je=He;function Fs(e,t,r){t=="__proto__"&&je?je(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}var Es=Fs,Ds=Es,Ns=_e,ks=Object.prototype,Hs=ks.hasOwnProperty;function js(e,t,r){var n=e[t];(!(Hs.call(e,t)&&Ns(n,r))||r===void 0&&!(t in e))&&Ds(e,t,r)}var qs=js,Gs=9007199254740991,zs=/^(?:0|[1-9]\d*)$/;function Us(e,t){var r=typeof e;return t=t==null?Gs:t,!!t&&(r=="number"||r!="symbol"&&zs.test(e))&&e>-1&&e%1==0&&e<t}var qe=Us,Ks=qs,Ls=Z,Vs=qe,Ge=te,Ws=le;function Bs(e,t,r,n){if(!Ge(e))return e;t=Ls(t,e);for(var a=-1,i=t.length,o=i-1,c=e;c!=null&&++a<i;){var u=Ws(t[a]),d=r;if(u==="__proto__"||u==="constructor"||u==="prototype")return e;if(a!=o){var y=c[u];d=n?n(y,u,c):void 0,d===void 0&&(d=Ge(y)?y:Vs(t[a+1])?[]:{})}Ks(c,u,d),c=c[u]}return e}var Ys=Bs,Xs=Ts,Js=Ys,Zs=Z;function Qs(e,t,r){for(var n=-1,a=t.length,i={};++n<a;){var o=t[n],c=Xs(e,o);r(c,o)&&Js(i,Zs(o,e),c)}return i}var Rs=Qs;function eo(e,t){return e!=null&&t in Object(e)}var to=eo,ro=ee,no=oe,ao="[object Arguments]";function so(e){return no(e)&&ro(e)==ao}var oo=so,ze=oo,io=oe,Ue=Object.prototype,co=Ue.hasOwnProperty,lo=Ue.propertyIsEnumerable,uo=ze(function(){return arguments}())?ze:function(e){return io(e)&&co.call(e,"callee")&&!lo.call(e,"callee")},Ke=uo,po=9007199254740991;function ho(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=po}var fo=ho,vo=Z,go=Ke,mo=U,yo=qe,bo=fo,_o=le;function Co(e,t,r){t=vo(t,e);for(var n=-1,a=t.length,i=!1;++n<a;){var o=_o(t[n]);if(!(i=e!=null&&r(e,o)))break;e=e[o]}return i||++n!=a?i:(a=e==null?0:e.length,!!a&&bo(a)&&yo(o,a)&&(mo(e)||go(e)))}var xo=Co,So=to,$o=xo;function wo(e,t){return e!=null&&$o(e,t,So)}var Ao=wo,Po=Rs,Io=Ao;function To(e,t){return Po(e,t,function(r,n){return Io(e,n)})}var Oo=To;function Mo(e,t){for(var r=-1,n=t.length,a=e.length;++r<n;)e[a+r]=t[r];return e}var Fo=Mo,Le=V,Eo=Ke,Do=U,Ve=Le?Le.isConcatSpreadable:void 0;function No(e){return Do(e)||Eo(e)||!!(Ve&&e&&e[Ve])}var ko=No,Ho=Fo,jo=ko;function We(e,t,r,n,a){var i=-1,o=e.length;for(r||(r=jo),a||(a=[]);++i<o;){var c=e[i];t>0&&r(c)?t>1?We(c,t-1,r,n,a):Ho(a,c):n||(a[a.length]=c)}return a}var qo=We,Go=qo;function zo(e){var t=e==null?0:e.length;return t?Go(e,1):[]}var Uo=zo;function Ko(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}var Lo=Ko,Vo=Lo,Be=Math.max;function Wo(e,t,r){return t=Be(t===void 0?e.length-1:t,0),function(){for(var n=arguments,a=-1,i=Be(n.length-t,0),o=Array(i);++a<i;)o[a]=n[t+a];a=-1;for(var c=Array(t+1);++a<t;)c[a]=n[a];return c[t]=r(o),Vo(e,this,c)}}var Bo=Wo;function Yo(e){return function(){return e}}var Xo=Yo;function Jo(e){return e}var Zo=Jo,Qo=Xo,Ye=He,Ro=Zo,ei=Ye?function(e,t){return Ye(e,"toString",{configurable:!0,enumerable:!1,value:Qo(t),writable:!0})}:Ro,ti=ei,ri=800,ni=16,ai=Date.now;function si(e){var t=0,r=0;return function(){var n=ai(),a=ni-(n-r);if(r=n,a>0){if(++t>=ri)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var oi=si,ii=ti,ci=oi,li=ci(ii),ui=li,pi=Uo,di=Bo,hi=ui;function fi(e){return hi(di(e,void 0,pi),e+"")}var vi=fi,gi=Oo,mi=vi,yi=mi(function(e,t){return e==null?{}:gi(e,t)}),bi=yi;const _i=he(bi),Ci={type:"object",properties:{[S.uid()]:{type:"void","x-component":"Action.Drawer","x-decorator":"Form","x-decorator-props":{useValues:e=>{const t=l.useRecord(),r=l.useRequest(()=>Promise.resolve({data:_i(t,["title","name","default"])}),k(I({},e),{manual:!0})),n=l.useActionContext();return h.useEffect(()=>{n.visible&&r.run()},[n.visible]),r}},title:'{{t("Edit role")}}',properties:{title:{"x-component":"CollectionField","x-decorator":"FormItem"},name:{"x-component":"CollectionField","x-decorator":"FormItem","x-disabled":!0},default:{title:"","x-component":"CollectionField","x-decorator":"FormItem","x-content":'{{t("Default role")}}',"x-reactions":e=>{e.initialValue?e.disabled=!0:e.disabled=!1}},footer:{type:"void","x-component":"Action.Drawer.Footer",properties:{cancel:{title:'{{t("Cancel")}}',"x-component":"Action","x-component-props":{useAction:"{{ cm.useCancelAction }}"}},submit:{title:'{{t("Submit")}}',"x-component":"Action","x-component-props":{type:"primary",useAction:"{{ cm.useUpdateAction }}"}}}}}}}},Q=()=>{const{t:e}=H(),{data:t,mutate:r}=l.useResourceActionContext(),[n,a]=h.useState(!1),[i,o]=h.useState(null),{role:c,setRole:u}=h.useContext(D),[d,y]=h.useState([]),[C,_]=h.useState(!1),w=l.useAPIClient(),P=h.useCallback(()=>A(this,null,function*(){const f=t==null?void 0:t.meta;if(!f||f.page>=f.totalPage)return;_(!0);const b=yield w.resource("roles").list({page:f.page+1,pageSize:f.pageSize,filter:{"name.$ne":"root"},showAnonymous:!0,sort:["createdAt"],appends:[]});r((b==null?void 0:b.data)||{}),_(!1)}),[t]),{lastItem:$,setLastItem:O}=ja({loadMore:P}),g=({key:f})=>{u(d.find(b=>b.name===f))};h.useEffect(()=>{d[0]&&u(d[0])},[d,u]),h.useEffect(()=>{var b,F;if(!((b=t==null?void 0:t.data)!=null&&b.length))return;const f=h.createRef();O(f),((F=t.meta)==null?void 0:F.page)>1?y(E=>E.concat(t.data)):y(t.data)},[t,O]);const m=h.useMemo(()=>d.map((f,b)=>({key:f.name,label:b===d.length-1?s.jsx("div",{ref:$,children:s.jsx(Q.Item,{item:f,onEdit:()=>{a(!0),o(f)}})}):s.jsx(Q.Item,{item:f,onEdit:()=>{a(!0),o(f)}})})),[d,$]);return s.jsxs(s.Fragment,{children:[d.length?s.jsx(p.Menu,{style:{border:"none",maxHeight:"65vh",overflowY:"auto"},items:[...m,...C?[{key:"loading",label:s.jsx(p.Spin,{})}]:[]],selectedKeys:[c==null?void 0:c.name],onSelect:g}):s.jsx(p.Empty,{image:p.Empty.PRESENTED_IMAGE_SIMPLE}),s.jsx(l.ActionContextProvider,{value:{visible:n,setVisible:a},children:s.jsx(l.RecordProvider,{record:i,collectionName:"departments",children:s.jsx(l.SchemaComponent,{scope:{t:e},schema:Ci})})})]})};Q.Item=function({item:t,onEdit:r}){const{t:n}=H(),{refreshAsync:a}=l.useResourceActionContext(),{modal:i,message:o}=p.App.useApp(),c=l.useAPIClient(),u=()=>{i.confirm({title:n("Delete"),content:n("Are you sure you want to delete it?"),onOk:()=>A(this,null,function*(){yield c.resource("roles").destroy({filterByTk:t.name}),o.success(n("Deleted successfully")),yield a()})})},d=({key:C,domEvent:_})=>{switch(_.stopPropagation(),C){case"edit":r();break;case"delete":u()}},y=S.Schema.compile(t.title,{t:n});return s.jsxs(p.Row,{children:[s.jsx(p.Col,{flex:3,style:{display:"inline-flex",alignItems:"center"},children:s.jsxs("span",{style:{whiteSpace:"nowrap",width:"120px",overflow:"hidden",textOverflow:"ellipsis"},children:[s.jsx(de.TagOutlined,{}),s.jsx("span",{style:{marginLeft:"10px"},title:y,children:y})]})}),s.jsxs(p.Col,{children:[t.default?s.jsx(p.Tag,{color:"success",bordered:!1,children:n("Default")}):null,s.jsx(p.Dropdown,{menu:{items:[{label:n("Edit"),key:"edit"},{label:n("Delete"),key:"delete"}],onClick:d},children:s.jsx(de.MoreOutlined,{})})]})]})};const Xe={name:"roles",filterTargetKey:"name",targetKey:"name",fields:[{type:"string",name:"title",interface:"input",uiSchema:{title:'{{t("Role display name")}}',type:"number","x-component":"Input",required:!0}},{type:"string",name:"name",interface:"input",uiSchema:{title:'{{t("Role UID")}}',type:"string","x-component":"Input"}},{type:"boolean",name:"default",interface:"boolean",uiSchema:{title:'{{t("Default role")}}',type:"boolean","x-component":"Checkbox"}}]},xi=()=>{const{t:e}=H(),t=l.usePlugin(ue),[r,n]=h.useState("permissions"),a=Array.from(t.rolesManager.list()).map(([u,d])=>({key:u,label:S.Schema.compile(d.title,{t:e}),children:d.Component?h.createElement(d.Component,{active:r===u}):null})),[i,o]=h.useState(null),c=l.useSchemaComponentContext();return s.jsx(l.SchemaComponentContext.Provider,{value:k(I({},c),{designable:!1}),children:s.jsx(D.Provider,{value:{role:i,setRole:o},children:s.jsx(p.Card,{children:s.jsxs(p.Row,{gutter:24,style:{flexWrap:"nowrap"},children:[s.jsx(p.Col,{flex:"280px",style:{borderRight:"1px solid #eee",minWidth:"250px"},children:s.jsx(l.ResourceActionProvider,{collection:Xe,request:{resource:"roles",action:"list",params:{filter:{"name.$ne":"root"},showAnonymous:!0,sort:["createdAt"],appends:[]}},children:s.jsxs(l.CollectionProvider_deprecated,{collection:Xe,children:[s.jsx(p.Row,{children:s.jsx(Re,{})}),s.jsx(p.Divider,{style:{margin:"12px 0"}}),s.jsx(Q,{})]})})}),s.jsx(p.Col,{flex:"auto",style:{overflow:"hidden"},children:s.jsx(p.Tabs,{activeKey:r,onChange:u=>n(u),items:[{key:"permissions",label:e("Permissions"),children:s.jsx(Ha,{active:r==="permissions"})},...a]})})]})})})})};class ue extends l.Plugin{constructor(){super(...arguments),this.rolesManager=new Qe}load(){return A(this,null,function*(){this.systemSettingsManager.add("id-auth.roles",{title:this.t("Roles & Permissions"),icon:"LockOutlined",Component:xi,aclSnippet:"pm.acl.roles",sort:3})})}}v.PluginACLClient=ue,v.RolesManagerContext=D,v.default=ue,Object.defineProperties(v,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
9
|
+
`),we=(e=[],t=[])=>{for(const r of e)t.push(r.aclSnippet),r.children&&r.children.length&&we(r.children,t);return t},Oa=({active:e})=>{const t=l.useApp(),{styles:r}=$e(),{role:n}=h.useContext(D),a=l.useAPIClient(),i=l.useCompile(),o=t.systemSettingsManager.getList(!1),c=t.systemSettingsManager.getAclSnippets(),[u,d]=h.useState((n==null?void 0:n.snippets)||[]),y=h.useMemo(()=>N.flatMap(o,g=>g.children?[g,...g.children]:g),[o]),C=h.useMemo(()=>u.includes("pm.*")&&u.every(g=>!g.startsWith("!pm.")),[u]),{t:_}=M.useTranslation(),{loading:w,refresh:P}=l.useRequest({resource:"roles.snippets",resourceOf:n==null?void 0:n.name,action:"list",params:{paginate:!1}},{ready:!!n&&e,refreshDeps:[n==null?void 0:n.name],manual:!0,onSuccess(g){d((g==null?void 0:g.data.filter(m=>y.find(f=>m.includes(`!${f.aclSnippet}`)||!m.startsWith("!pm."))))||[])}});if(!n)return;const $=a.resource("roles.snippets",n==null?void 0:n.name),O=(g,m)=>A(this,null,function*(){const b=we(m==null?void 0:m.children,[]).concat(m.aclSnippet);g?(yield $.add({values:b.map(F=>"!"+F)}),P()):(yield $.remove({values:b.map(F=>"!"+F)}),P()),p.message.success(_("Saved successfully"))});return s.jsx(p.Table,{className:r,loading:w,rowKey:"key",pagination:!1,expandable:{defaultExpandAllRows:!0},columns:[{dataIndex:"title",title:_("Plugin name"),render:g=>i(g)},{dataIndex:"accessible",title:s.jsxs(s.Fragment,{children:[s.jsx(p.Checkbox,{checked:C,onChange:()=>A(this,null,function*(){const g=c.map(m=>"!"+m);C?yield $.add({values:g}):yield $.remove({values:g}),P(),p.message.success(_("Saved successfully"))})}),_("Accessible")]}),render:(g,m)=>{const f=!u.includes("!"+m.aclSnippet);return s.jsx(p.Checkbox,{checked:f,onChange:()=>O(f,m)})}}],dataSource:o.filter(g=>g.isTopLevel!==!1).map(g=>g.showTabs!==!1?g:N.omit(g,"children"))})},Ma=e=>{var r;if(!e)return{};const t={};return(r=e==null?void 0:e.forEach)==null||r.call(e,n=>{const[a,i]=n.split(":");t[a]=i||"all"}),t},Ae=e=>{const t=[];for(const r in e)if(Object.prototype.hasOwnProperty.call(e,r)){const n=e[r];n==="all"?t.push(r):t.push(`${r}:${n}`)}return t},Fa=S.connect(e=>{const{onChange:t}=e,r=tt(),n=l.useCompile(),{t:a}=M.useTranslation(),i=S.useField(),o=Ma(i.value);return s.jsx("div",{children:s.jsx(p.Table,{rowKey:"name",size:"small",pagination:!1,columns:[{dataIndex:"displayName",title:a("Action display name"),render:c=>n(c)},{dataIndex:"onNewRecord",title:a("Action type"),render:c=>c?s.jsx(p.Tag,{color:"green",children:a("Action on new records")}):s.jsx(p.Tag,{color:"geekblue",children:a("Action on existing records")})},{dataIndex:"enabled",title:a("Allow"),render:(c,u)=>s.jsx(p.Checkbox,{checked:c,"aria-label":`${u.name}_checkbox`,onChange:d=>{c?delete o[u.name]:o[u.name]="all",t(Ae(o))}})},{dataIndex:"scope",title:a("Data scope"),render:(c,u)=>!u.onNewRecord&&s.jsx(p.Select,{"data-testid":"select-data-scope",popupMatchSelectWidth:!1,size:"small",value:c,options:[{label:a("All records"),value:"all"},{label:a("Own records"),value:"own"}],onChange:d=>{o[u.name]=d,t(Ae(o))}})}],dataSource:r==null?void 0:r.map(c=>{let u="all",d=!1;return o[c.name]&&(d=!0,u=o[c.name]),k(I({},c),{enabled:d,scope:u})})})})}),Ea=S.connect(e=>{const{t}=M.useTranslation();return s.jsxs(p.Checkbox.Group,{style:{width:"100%",display:"block"},value:e.value,onChange:r=>{const n=["ui.*","pm","pm.*","app"],a=n.map(o=>`!${o}`),i=Ta([...e.value||[],...r]).filter(o=>o&&!a.includes(o)).map(o=>!n.includes(o)||r!=null&&r.includes(o)?o:`!${o}`);for(const o of n)!i.includes(o)&&!i.includes(`!${o}`)&&i.push(`!${o}`);e.onChange(i)},children:[s.jsx("div",{style:{marginTop:16},children:s.jsx(p.Checkbox,{value:"ui.*",children:t("Allows to configure interface")})}),s.jsx("div",{style:{marginTop:8},children:s.jsx(p.Checkbox,{value:"pm",children:t("Allows to install, activate, disable plugins")})}),s.jsx("div",{style:{marginTop:8},children:s.jsx(p.Checkbox,{value:"pm.*",children:t("Allows to configure plugins")})}),s.jsx("div",{style:{marginTop:8},children:s.jsx(p.Checkbox,{value:"app",children:t("Allows to clear cache, reboot application")})})]})}),Da=({active:e})=>{var u;const{role:t,setRole:r}=h.useContext(D),{t:n}=H(),a=l.useAPIClient(),i=(u=t==null?void 0:t.snippets)==null?void 0:u.includes("pm.*"),o=T.useMemoizedFn(d=>A(this,null,function*(){yield a.resource("roles").update({filterByTk:t.name,values:d.values}),r(I(I({},t),d.values)),p.message.success(n("Saved successfully"))})),c=h.useMemo(()=>S.createForm({values:t,effects(){S.onFormValuesChange(d=>A(this,null,function*(){yield o(d)}))}}),[t,o]);return s.jsx(l.SchemaComponent,{components:{SnippetCheckboxGroup:Ea,StrategyActions:Fa,PluginPermissions:Oa},scope:{pm:i},schema:{type:"void",name:S.uid(),"x-component":"div",properties:{general:{"x-component":"FormV2","x-component-props":{form:c},properties:{snippets:{title:n("Configure permissions"),type:"boolean","x-decorator":"FormItem","x-component":"SnippetCheckboxGroup"}}},plugins:{"x-component":"FormV2",properties:{pluginSettings:{title:n("Plugin settings"),"x-decorator":"FormItem","x-component":"PluginPermissions","x-visible":"{{pm}}"}}}}}})},ae=h.createContext(null);ae.displayName="MenuItemsContext";const Pe=(e={})=>{const t=[];for(const r in e)if(Object.prototype.hasOwnProperty.call(e,r)){const n=e[r],a={title:n.title,uid:n["x-uid"]};n.properties&&(a.children=Pe(n.properties)),t.push(a)}return t},Na=()=>h.useContext(ae),Ie=e=>{var i,o;const r={url:`uiSchemas:getProperties/${l.useAdminSchemaUid()}`},n=l.useRequest(r);if(n.loading)return s.jsx(p.Spin,{});const a=Pe((o=(i=n.data)==null?void 0:i.data)==null?void 0:o.properties);return s.jsx(ae.Provider,{value:{service:n,items:a},children:e.children})},Te=e=>{if(!Array.isArray(e))return[];const t=[];for(const r of e)t.push(r.uid),t.push(...Te(r.children));return t},Oe=(e,t,r=[])=>{if(!e)return[];for(const n of e){if(r.push(n.uid),t(n))return r;if(n.children){const a=Oe(n.children,t,r);if(a.length)return a}r.pop()}return[]},Me=(e=[],t=[])=>{for(const r of e)t.push(r.uid),r.children&&r.children.length&&Me(r.children,t);return t},ka=({active:e})=>{const{styles:t}=$e(),{role:r,setRole:n}=h.useContext(D),a=l.useAPIClient(),{items:i}=Na(),{t:o}=M.useTranslation(),c=Te(i),[u,d]=h.useState([]),{loading:y,refresh:C}=l.useRequest({resource:"roles.menuUiSchemas",resourceOf:r.name,action:"list",params:{paginate:!1}},{ready:!!r&&e,refreshDeps:[r==null?void 0:r.name],onSuccess(m){var f;d(((f=m==null?void 0:m.data)==null?void 0:f.map(b=>b["x-uid"]))||[])}}),_=a.resource("roles.menuUiSchemas",r.name),w=c.length===u.length,P=(m,f)=>A(this,null,function*(){const b=Oe(i,E=>E.uid===f.uid),F=Me(f==null?void 0:f.children,[]);if(m){const E=F.concat(f.uid),pe=u.filter(Ci=>!E.includes(Ci));d([...pe]),yield _.remove({values:E})}else{const E=F.concat(b);d(pe=>N.uniq([...pe,...E])),yield _.add({values:E})}p.message.success(o("Saved successfully"))}),$=m=>m.map(f=>{const b=o(f.title);return f.children?k(I({},f),{title:b,children:$(f.children)}):k(I({},f),{title:b})}),O=T.useMemoizedFn(m=>A(this,null,function*(){yield a.resource("roles").update({filterByTk:r.name,values:m.values}),n(I(I({},r),m.values)),p.message.success(o("Saved successfully"))})),g=h.useMemo(()=>S.createForm({values:r,effects(){S.onFormValuesChange(m=>A(this,null,function*(){yield O(m)}))}}),[r,O]);return s.jsxs(s.Fragment,{children:[s.jsx(l.SchemaComponent,{schema:{type:"void",name:S.uid(),"x-component":"FormV2","x-component-props":{form:g},properties:{allowNewMenu:{title:o("Menu permissions"),"x-decorator":"FormItem","x-component":"Checkbox","x-content":o("New menu items are allowed to be accessed by default.")}}}}),s.jsx(p.Table,{className:t,loading:y,rowKey:"uid",pagination:!1,expandable:{defaultExpandAllRows:!0},columns:[{dataIndex:"title",title:o("Menu item title")},{dataIndex:"accessible",title:s.jsxs(s.Fragment,{children:[s.jsx(p.Checkbox,{checked:w,onChange:m=>A(this,null,function*(){w?yield _.set({values:[]}):yield _.set({values:c}),C(),p.message.success(o("Saved successfully"))})})," ",o("Accessible")]}),render:(m,f)=>{const b=u.includes(f.uid);return s.jsx(p.Checkbox,{checked:b,onChange:()=>P(b,f)})}}],dataSource:$(i)})]})},se=e=>s.jsx("div",{style:{maxHeight:"60vh",overflowY:"auto"},children:e.children}),Ha=({active:e})=>{var _;const{t}=H(),[r,n]=h.useState("general"),{role:a,setRole:i}=h.useContext(D),o=(_=a==null?void 0:a.snippets)==null?void 0:_.includes("pm.*"),u=l.useApp().getComponent("DataSourcePermissionManager"),d=h.useMemo(()=>[{key:"general",label:t("System"),children:s.jsx(se,{children:s.jsx(Da,{active:r==="general"&&e})})},{key:"menu",label:t("Menu"),children:s.jsx(se,{children:s.jsx(Ie,{children:s.jsx(ka,{active:r==="menu"&&e})})})},...u?[{key:"dataSource",label:t("Data sources"),children:s.jsx(se,{children:s.jsx(Ie,{children:s.jsx(u,{role:a,active:r==="dataSource"&&e})})})}]:[]],[o,r,e,t]),y=l.useAPIClient(),{data:C}=l.useRequest(()=>y.resource("roles").get({filterByTk:a==null?void 0:a.name}).then(w=>{var $,O;const P=($=w==null?void 0:w.data)==null?void 0:$.data;return(O=P.snippets)==null||O.forEach(g=>{P[g]=!0}),P}),{ready:e&&!!a,refreshDeps:[a==null?void 0:a.name]});return h.useEffect(()=>{n("general")},[a==null?void 0:a.name]),h.useEffect(()=>{i(C)},[C]),s.jsx(et,{children:s.jsx(p.Tabs,{type:"card",activeKey:r,onChange:w=>n(w),items:d})})},ja=({loadMore:e})=>{const[t,r]=h.useState(null),n=h.useRef(null),a=h.useCallback(i=>{i&&(n.current&&n.current.disconnect(),n.current=new IntersectionObserver(o=>{o.forEach(c=>{c.target===i.current&&c.isIntersecting&&(n.current&&n.current.unobserve(i.current),e())})}),i.current&&n.current&&n.current.observe(i.current))},[e]);return h.useEffect(()=>(a(t),()=>{n.current&&n.current.disconnect()}),[t,a]),{lastItem:t,setLastItem:r}};var qa=Array.isArray,U=qa;function Ga(e){return e!=null&&typeof e=="object"}var oe=Ga,za=ee,Ua=oe,Ka="[object Symbol]";function La(e){return typeof e=="symbol"||Ua(e)&&za(e)==Ka}var ie=La,Va=U,Wa=ie,Ba=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Xa=/^\w*$/;function Ya(e,t){if(Va(e))return!1;var r=typeof e;return r=="number"||r=="symbol"||r=="boolean"||e==null||Wa(e)?!0:Xa.test(e)||!Ba.test(e)||t!=null&&e in Object(t)}var Ja=Ya,Fe=xe,Za="Expected a function";function ce(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(Za);var r=function(){var n=arguments,a=t?t.apply(this,n):n[0],i=r.cache;if(i.has(a))return i.get(a);var o=e.apply(this,n);return r.cache=i.set(a,o)||i,o};return r.cache=new(ce.Cache||Fe),r}ce.Cache=Fe;var Qa=ce,Ra=Qa,es=500;function ts(e){var t=Ra(e,function(n){return r.size===es&&r.clear(),n}),r=t.cache;return t}var rs=ts,ns=rs,as=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ss=/\\(\\)?/g,os=ns(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(as,function(r,n,a,i){t.push(a?i.replace(ss,"$1"):n||r)}),t}),is=os;function cs(e,t){for(var r=-1,n=e==null?0:e.length,a=Array(n);++r<n;)a[r]=t(e[r],r,e);return a}var ls=cs,Ee=V,us=ls,ps=U,ds=ie,De=Ee?Ee.prototype:void 0,Ne=De?De.toString:void 0;function ke(e){if(typeof e=="string")return e;if(ps(e))return us(e,ke)+"";if(ds(e))return Ne?Ne.call(e):"";var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}var hs=ke,fs=hs;function vs(e){return e==null?"":fs(e)}var gs=vs,ms=U,ys=Ja,bs=is,_s=gs;function Cs(e,t){return ms(e)?e:ys(e,t)?[e]:bs(_s(e))}var Z=Cs,xs=ie;function Ss(e){if(typeof e=="string"||xs(e))return e;var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}var le=Ss,$s=Z,ws=le;function As(e,t){t=$s(t,e);for(var r=0,n=t.length;e!=null&&r<n;)e=e[ws(t[r++])];return r&&r==n?e:void 0}var Ps=As,Is=W,Ts=function(){try{var e=Is(Object,"defineProperty");return e({},"",{}),e}catch(t){}}(),He=Ts,je=He;function Os(e,t,r){t=="__proto__"&&je?je(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}var Ms=Os,Fs=Ms,Es=_e,Ds=Object.prototype,Ns=Ds.hasOwnProperty;function ks(e,t,r){var n=e[t];(!(Ns.call(e,t)&&Es(n,r))||r===void 0&&!(t in e))&&Fs(e,t,r)}var Hs=ks,js=9007199254740991,qs=/^(?:0|[1-9]\d*)$/;function Gs(e,t){var r=typeof e;return t=t==null?js:t,!!t&&(r=="number"||r!="symbol"&&qs.test(e))&&e>-1&&e%1==0&&e<t}var qe=Gs,zs=Hs,Us=Z,Ks=qe,Ge=te,Ls=le;function Vs(e,t,r,n){if(!Ge(e))return e;t=Us(t,e);for(var a=-1,i=t.length,o=i-1,c=e;c!=null&&++a<i;){var u=Ls(t[a]),d=r;if(u==="__proto__"||u==="constructor"||u==="prototype")return e;if(a!=o){var y=c[u];d=n?n(y,u,c):void 0,d===void 0&&(d=Ge(y)?y:Ks(t[a+1])?[]:{})}zs(c,u,d),c=c[u]}return e}var Ws=Vs,Bs=Ps,Xs=Ws,Ys=Z;function Js(e,t,r){for(var n=-1,a=t.length,i={};++n<a;){var o=t[n],c=Bs(e,o);r(c,o)&&Xs(i,Ys(o,e),c)}return i}var Zs=Js;function Qs(e,t){return e!=null&&t in Object(e)}var Rs=Qs,eo=ee,to=oe,ro="[object Arguments]";function no(e){return to(e)&&eo(e)==ro}var ao=no,ze=ao,so=oe,Ue=Object.prototype,oo=Ue.hasOwnProperty,io=Ue.propertyIsEnumerable,co=ze(function(){return arguments}())?ze:function(e){return so(e)&&oo.call(e,"callee")&&!io.call(e,"callee")},Ke=co,lo=9007199254740991;function uo(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=lo}var po=uo,ho=Z,fo=Ke,vo=U,go=qe,mo=po,yo=le;function bo(e,t,r){t=ho(t,e);for(var n=-1,a=t.length,i=!1;++n<a;){var o=yo(t[n]);if(!(i=e!=null&&r(e,o)))break;e=e[o]}return i||++n!=a?i:(a=e==null?0:e.length,!!a&&mo(a)&&go(o,a)&&(vo(e)||fo(e)))}var _o=bo,Co=Rs,xo=_o;function So(e,t){return e!=null&&xo(e,t,Co)}var $o=So,wo=Zs,Ao=$o;function Po(e,t){return wo(e,t,function(r,n){return Ao(e,n)})}var Io=Po;function To(e,t){for(var r=-1,n=t.length,a=e.length;++r<n;)e[a+r]=t[r];return e}var Oo=To,Le=V,Mo=Ke,Fo=U,Ve=Le?Le.isConcatSpreadable:void 0;function Eo(e){return Fo(e)||Mo(e)||!!(Ve&&e&&e[Ve])}var Do=Eo,No=Oo,ko=Do;function We(e,t,r,n,a){var i=-1,o=e.length;for(r||(r=ko),a||(a=[]);++i<o;){var c=e[i];t>0&&r(c)?t>1?We(c,t-1,r,n,a):No(a,c):n||(a[a.length]=c)}return a}var Ho=We,jo=Ho;function qo(e){var t=e==null?0:e.length;return t?jo(e,1):[]}var Go=qo;function zo(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}var Uo=zo,Ko=Uo,Be=Math.max;function Lo(e,t,r){return t=Be(t===void 0?e.length-1:t,0),function(){for(var n=arguments,a=-1,i=Be(n.length-t,0),o=Array(i);++a<i;)o[a]=n[t+a];a=-1;for(var c=Array(t+1);++a<t;)c[a]=n[a];return c[t]=r(o),Ko(e,this,c)}}var Vo=Lo;function Wo(e){return function(){return e}}var Bo=Wo;function Xo(e){return e}var Yo=Xo,Jo=Bo,Xe=He,Zo=Yo,Qo=Xe?function(e,t){return Xe(e,"toString",{configurable:!0,enumerable:!1,value:Jo(t),writable:!0})}:Zo,Ro=Qo,ei=800,ti=16,ri=Date.now;function ni(e){var t=0,r=0;return function(){var n=ri(),a=ti-(n-r);if(r=n,a>0){if(++t>=ei)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var ai=ni,si=Ro,oi=ai,ii=oi(si),ci=ii,li=Go,ui=Vo,pi=ci;function di(e){return pi(ui(e,void 0,li),e+"")}var hi=di,fi=Io,vi=hi,gi=vi(function(e,t){return e==null?{}:fi(e,t)}),mi=gi;const yi=he(mi),bi={type:"object",properties:{[S.uid()]:{type:"void","x-component":"Action.Drawer","x-decorator":"Form","x-decorator-props":{useValues:e=>{const t=l.useRecord(),r=l.useRequest(()=>Promise.resolve({data:yi(t,["title","name","default"])}),k(I({},e),{manual:!0})),n=l.useActionContext();return h.useEffect(()=>{n.visible&&r.run()},[n.visible]),r}},title:'{{t("Edit role")}}',properties:{title:{"x-component":"CollectionField","x-decorator":"FormItem"},name:{"x-component":"CollectionField","x-decorator":"FormItem","x-disabled":!0},default:{title:"","x-component":"CollectionField","x-decorator":"FormItem","x-content":'{{t("Default role")}}',"x-reactions":e=>{e.initialValue?e.disabled=!0:e.disabled=!1}},footer:{type:"void","x-component":"Action.Drawer.Footer",properties:{cancel:{title:'{{t("Cancel")}}',"x-component":"Action","x-component-props":{useAction:"{{ cm.useCancelAction }}"}},submit:{title:'{{t("Submit")}}',"x-component":"Action","x-component-props":{type:"primary",useAction:"{{ cm.useUpdateAction }}"}}}}}}}},Q=()=>{const{t:e}=H(),{data:t,mutate:r}=l.useResourceActionContext(),[n,a]=h.useState(!1),[i,o]=h.useState(null),{role:c,setRole:u}=h.useContext(D),[d,y]=h.useState([]),[C,_]=h.useState(!1),w=l.useAPIClient(),P=h.useCallback(()=>A(this,null,function*(){const f=t==null?void 0:t.meta;if(!f||f.page>=f.totalPage)return;_(!0);const b=yield w.resource("roles").list({page:f.page+1,pageSize:f.pageSize,filter:{"name.$ne":"root"},showAnonymous:!0,sort:["createdAt"],appends:[]});r((b==null?void 0:b.data)||{}),_(!1)}),[t]),{lastItem:$,setLastItem:O}=ja({loadMore:P}),g=({key:f})=>{u(d.find(b=>b.name===f))};h.useEffect(()=>{d[0]&&u(d[0])},[d,u]),h.useEffect(()=>{var b,F;if(!((b=t==null?void 0:t.data)!=null&&b.length))return;const f=h.createRef();O(f),((F=t.meta)==null?void 0:F.page)>1?y(E=>E.concat(t.data)):y(t.data)},[t,O]);const m=h.useMemo(()=>d.map((f,b)=>({key:f.name,label:b===d.length-1?s.jsx("div",{ref:$,children:s.jsx(Q.Item,{item:f,onEdit:()=>{a(!0),o(f)}})}):s.jsx(Q.Item,{item:f,onEdit:()=>{a(!0),o(f)}})})),[d,$]);return s.jsxs(s.Fragment,{children:[d.length?s.jsx(p.Menu,{style:{border:"none",maxHeight:"65vh",overflowY:"auto"},items:[...m,...C?[{key:"loading",label:s.jsx(p.Spin,{})}]:[]],selectedKeys:[c==null?void 0:c.name],onSelect:g}):s.jsx(p.Empty,{image:p.Empty.PRESENTED_IMAGE_SIMPLE}),s.jsx(l.ActionContextProvider,{value:{visible:n,setVisible:a},children:s.jsx(l.RecordProvider,{record:i,collectionName:"departments",children:s.jsx(l.SchemaComponent,{scope:{t:e},schema:bi})})})]})};Q.Item=function({item:t,onEdit:r}){const{t:n}=H(),{refreshAsync:a}=l.useResourceActionContext(),{modal:i,message:o}=p.App.useApp(),c=l.useAPIClient(),u=()=>{i.confirm({title:n("Delete"),content:n("Are you sure you want to delete it?"),onOk:()=>A(this,null,function*(){yield c.resource("roles").destroy({filterByTk:t.name}),o.success(n("Deleted successfully")),yield a()})})},d=({key:C,domEvent:_})=>{switch(_.stopPropagation(),C){case"edit":r();break;case"delete":u()}},y=S.Schema.compile(t.title,{t:n});return s.jsxs(p.Row,{children:[s.jsx(p.Col,{flex:3,style:{display:"inline-flex",alignItems:"center"},children:s.jsxs("span",{style:{whiteSpace:"nowrap",width:"120px",overflow:"hidden",textOverflow:"ellipsis"},children:[s.jsx(de.TagOutlined,{}),s.jsx("span",{style:{marginLeft:"10px"},title:y,children:y})]})}),s.jsxs(p.Col,{children:[t.default?s.jsx(p.Tag,{color:"success",bordered:!1,children:n("Default")}):null,s.jsx(p.Dropdown,{menu:{items:[{label:n("Edit"),key:"edit"},{label:n("Delete"),key:"delete"}],onClick:d},children:s.jsx(de.MoreOutlined,{})})]})]})};const Ye={name:"roles",filterTargetKey:"name",targetKey:"name",fields:[{type:"string",name:"title",interface:"input",uiSchema:{title:'{{t("Role display name")}}',type:"number","x-component":"Input",required:!0}},{type:"string",name:"name",interface:"input",uiSchema:{title:'{{t("Role UID")}}',type:"string","x-component":"Input"}},{type:"boolean",name:"default",interface:"boolean",uiSchema:{title:'{{t("Default role")}}',type:"boolean","x-component":"Checkbox"}}]},_i=()=>{const{t:e}=H(),t=l.usePlugin(ue),[r,n]=h.useState("permissions"),a=Array.from(t.rolesManager.list()).map(([u,d])=>({key:u,label:S.Schema.compile(d.title,{t:e}),children:d.Component?h.createElement(d.Component,{active:r===u}):null})),[i,o]=h.useState(null),c=l.useSchemaComponentContext();return s.jsx(l.SchemaComponentContext.Provider,{value:k(I({},c),{designable:!1}),children:s.jsx(D.Provider,{value:{role:i,setRole:o},children:s.jsx(p.Card,{children:s.jsxs(p.Row,{gutter:24,style:{flexWrap:"nowrap"},children:[s.jsx(p.Col,{flex:"280px",style:{borderRight:"1px solid #eee",minWidth:"250px"},children:s.jsx(l.ResourceActionProvider,{collection:Ye,request:{resource:"roles",action:"list",params:{filter:{"name.$ne":"root"},showAnonymous:!0,sort:["createdAt"],appends:[]}},children:s.jsxs(l.CollectionProvider_deprecated,{collection:Ye,children:[s.jsx(p.Row,{children:s.jsx(Re,{})}),s.jsx(p.Divider,{style:{margin:"12px 0"}}),s.jsx(Q,{})]})})}),s.jsx(p.Col,{flex:"auto",style:{overflow:"hidden"},children:s.jsx(p.Tabs,{activeKey:r,onChange:u=>n(u),items:[{key:"permissions",label:e("Permissions"),children:s.jsx(Ha,{active:r==="permissions"})},...a]})})]})})})})};class ue extends l.Plugin{constructor(){super(...arguments),this.rolesManager=new Qe}load(){return A(this,null,function*(){this.systemSettingsManager.add("id-auth.roles",{title:this.t("Roles & Permissions"),icon:"LockOutlined",Component:_i,aclSnippet:"pm.acl.roles",sort:3})})}}v.PluginACLClient=ue,v.RolesManagerContext=D,v.default=ue,Object.defineProperties(v,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
package/dist/externalVersion.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
module.exports = {
|
|
2
2
|
"react": "18.3.1",
|
|
3
|
-
"@tachybase/client": "1.0.
|
|
4
|
-
"@tachybase/schema": "1.0.
|
|
3
|
+
"@tachybase/client": "1.0.25",
|
|
4
|
+
"@tachybase/schema": "1.0.25",
|
|
5
5
|
"antd": "5.22.5",
|
|
6
6
|
"@ant-design/icons": "5.5.2",
|
|
7
7
|
"react-i18next": "15.2.0",
|
|
8
|
-
"@tachybase/utils": "1.0.
|
|
9
|
-
"@tachybase/actions": "1.0.
|
|
10
|
-
"@tachybase/cache": "1.0.
|
|
11
|
-
"@tachybase/database": "1.0.
|
|
12
|
-
"@tachybase/server": "1.0.
|
|
8
|
+
"@tachybase/utils": "1.0.25",
|
|
9
|
+
"@tachybase/actions": "1.0.25",
|
|
10
|
+
"@tachybase/cache": "1.0.25",
|
|
11
|
+
"@tachybase/database": "1.0.25",
|
|
12
|
+
"@tachybase/server": "1.0.25",
|
|
13
13
|
"async-mutex": "0.3.2",
|
|
14
14
|
"lodash": "4.17.21",
|
|
15
|
-
"@tachybase/test": "1.0.
|
|
15
|
+
"@tachybase/test": "1.0.25",
|
|
16
16
|
"ahooks": "3.8.4",
|
|
17
|
-
"@tachybase/components": "1.0.
|
|
18
|
-
"@tachybase/acl": "1.0.
|
|
17
|
+
"@tachybase/components": "1.0.25",
|
|
18
|
+
"@tachybase/acl": "1.0.25"
|
|
19
19
|
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tachybase/module-acl",
|
|
3
3
|
"displayName": "Access control",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.25",
|
|
5
5
|
"description": "Based on roles, resources, and actions, access control can precisely manage interface configuration permissions, data operation permissions, menu access permissions, and plugin permissions.",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"Users & permissions"
|
|
@@ -20,18 +20,18 @@
|
|
|
20
20
|
"react": "^18.3.1",
|
|
21
21
|
"react-dom": "^18.3.1",
|
|
22
22
|
"react-i18next": "^15.2.0",
|
|
23
|
-
"@tachybase/components": "1.0.
|
|
24
|
-
"@tachybase/schema": "1.0.
|
|
23
|
+
"@tachybase/components": "1.0.25",
|
|
24
|
+
"@tachybase/schema": "1.0.25"
|
|
25
25
|
},
|
|
26
26
|
"peerDependencies": {
|
|
27
|
-
"@tachybase/acl": "1.0.
|
|
28
|
-
"@tachybase/actions": "1.0.
|
|
29
|
-
"@tachybase/cache": "1.0.
|
|
30
|
-
"@tachybase/client": "1.0.
|
|
31
|
-
"@tachybase/database": "1.0.
|
|
32
|
-
"@tachybase/server": "1.0.
|
|
33
|
-
"@tachybase/
|
|
34
|
-
"@tachybase/
|
|
27
|
+
"@tachybase/acl": "1.0.25",
|
|
28
|
+
"@tachybase/actions": "1.0.25",
|
|
29
|
+
"@tachybase/cache": "1.0.25",
|
|
30
|
+
"@tachybase/client": "1.0.25",
|
|
31
|
+
"@tachybase/database": "1.0.25",
|
|
32
|
+
"@tachybase/server": "1.0.25",
|
|
33
|
+
"@tachybase/test": "1.0.25",
|
|
34
|
+
"@tachybase/utils": "1.0.25"
|
|
35
35
|
},
|
|
36
36
|
"description.zh-CN": "基于角色、资源和操作的权限控制,可以精确控制界面配置权限、数据操作权限、菜单访问权限、插件权限。",
|
|
37
37
|
"displayName.zh-CN": "权限控制",
|