@nocobase/plugin-acl 2.1.0-beta.29 → 2.1.0-beta.32
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-v2/index.js +1 -1
- package/dist/externalVersion.js +10 -10
- package/package.json +2 -2
package/dist/client-v2/index.js
CHANGED
|
@@ -7,4 +7,4 @@
|
|
|
7
7
|
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("@nocobase/client-v2")):"function"==typeof define&&define.amd?define("@nocobase/plugin-acl",["@nocobase/client-v2"],t):"object"==typeof exports?exports["@nocobase/plugin-acl"]=t(require("@nocobase/client-v2")):e["@nocobase/plugin-acl"]=t(e["@nocobase/client-v2"])}(self,function(e){return function(){"use strict";var t={485:function(t){t.exports=e}},n={};function o(e){var r=n[e];if(void 0!==r)return r.exports;var i=n[e]={exports:{}};return t[e](i,i.exports,o),i.exports}o.d=function(e,t){for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.r=function(e){"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.g.importScripts&&(r=o.g.location+"");var r,i=o.g.document;if(!r&&i&&(i.currentScript&&"SCRIPT"===i.currentScript.tagName.toUpperCase()&&(r=i.currentScript.src),!r)){var l=i.getElementsByTagName("script");if(l.length)for(var s=l.length-1;s>-1&&(!r||!/^http(s?):/.test(r));)r=l[s--].src}if(!r)throw Error("Automatic publicPath is not supported in this browser");o.p=r.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/");var u={};return!function(){var e="",t="u">typeof document?document.currentScript:null;if(t&&t.src&&(e=t.src.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/")),!e){var n=window.__webpack_public_path__||"";n&&("/"!==n.charAt(n.length-1)&&(n+="/"),e=n+"static/plugins/@nocobase/plugin-acl/dist/client-v2/")}if(!e){if(!(e=window.__nocobase_public_path__||"")&&window.location&&window.location.pathname){var r=window.location.pathname||"/",i=r.indexOf("/v2/");e=i>=0?r.slice(0,i+1):"/"}e&&(e=e.replace(/\/v2\/?$/,"/")),e||(e="/"),"/"!==e.charAt(e.length-1)&&(e+="/"),e+="static/plugins/@nocobase/plugin-acl/dist/client-v2/"}o.p=e}(),!function(){o.r(u),o.d(u,{default:function(){return P}});var e=o(485),t={"en-US":JSON.parse('{"Allow roles union":"Allow roles union","Allow users to use role union, which means they can use permissions from all their roles simultaneously, or switch between individual roles.":"Allow users to use role union, which means they can use permissions from all their roles simultaneously, or switch between individual roles.","Data sources":"Data sources","Desktop menu":"Desktop menu","Do not use role union. Users need to switch between their roles individually.":"Do not use role union. Users need to switch between their roles individually.","Force users to use only role union. They cannot switch between individual roles.":"Force users to use only role union. They cannot switch between individual roles.","Full permissions":"Full permissions","General":"General","Independent roles":"Independent roles","New role":"New role","Permissions":"Permissions","Please select role mode":"Please select role mode","Plugin settings":"Plugin settings","Role mode":"Role mode","Role mode doc":"https://docs.nocobase.com/handbook/acl/manual","Roles & Permissions":"Roles & Permissions","Roles union only":"Roles union only","Saved successfully":"Saved successfully","The current user has no roles. Please try another account.":"The current user has no roles. Please try another account.","The user role does not exist. Please try signing in again":"The user role does not exist. Please try signing in again"}'),"zh-CN":JSON.parse('{"Allow roles union":"允许角色并集","Allow users to use role union, which means they can use permissions from all their roles simultaneously, or switch between individual roles.":"允许用户使用角色并集,即可以同时使用自己拥有的所有角色的权限,也允许用户逐个切换自己的角色。","Data sources":"数据源","Desktop menu":"桌面端菜单","Do not use role union. Users need to switch between their roles individually.":"不使用角色并集,用户需要逐个切换自己拥有的角色。","Force users to use only role union. They cannot switch between individual roles.":"强制用户仅能使用角色并集,不能逐个切换角色。","Full permissions":"全部权限","General":"通用","Independent roles":"独立角色","New role":"新建角色","Permissions":"权限","Please select role mode":"请选择角色模式","Plugin settings":"插件设置","Role mode":"角色模式","Role mode doc":"https://docs-cn.nocobase.com/handbook/acl/manual","Roles & Permissions":"角色和权限","Roles union only":"仅角色并集","Saved successfully":"保存成功","The current user has no roles. Please try another account.":"当前用户没有角色,请使用其他账号。","The user role does not exist. Please try signing in again":"用户角色不存在,请尝试重新登录。"}')};function n(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n<t;n++)o[n]=e[n];return o}function r(e,t,n,o,r,i,l){try{var s=e[i](l),u=s.value}catch(e){n(e);return}s.done?t(u):Promise.resolve(u).then(o,r)}function i(e){return function(){var t=this,n=arguments;return new Promise(function(o,i){var l=e.apply(t,n);function s(e){r(l,o,i,s,u,"next",e)}function u(e){r(l,o,i,s,u,"throw",e)}s(void 0)})}}function l(e,t,n){return t=h(t),function(e,t){var n;if(t&&("object"==((n=t)&&"u">typeof Symbol&&n.constructor===Symbol?"symbol":typeof n)||"function"==typeof t))return t;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e,m()?Reflect.construct(t,n||[],h(e).constructor):t.apply(e,n))}function s(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}function a(e,t,n){return(a=m()?Reflect.construct:function(e,t,n){var o=[null];o.push.apply(o,t);var r=new(Function.bind.apply(e,o));return n&&y(r,n.prototype),r}).apply(null,arguments)}function c(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function p(e,t,n){return t&&c(e.prototype,t),n&&c(e,n),e}function f(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function h(e){return(h=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function d(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&y(e,t)}function y(e,t){return(y=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function b(e,t){if(e){if("string"==typeof e)return n(e,t);var o=Object.prototype.toString.call(e).slice(8,-1);if("Object"===o&&e.constructor&&(o=e.constructor.name),"Map"===o||"Set"===o)return Array.from(o);if("Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return n(e,t)}}function v(e){var t="function"==typeof Map?new Map:void 0;return(v=function(e){if(null===e||-1===Function.toString.call(e).indexOf("[native code]"))return e;if("function"!=typeof e)throw TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return a(e,arguments,h(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),y(n,e)})(e)}function m(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(m=function(){return!!e})()}function w(e,t){var n,o,r,i={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]},l=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),s=Object.defineProperty;return s(l,"next",{value:u(0)}),s(l,"throw",{value:u(1)}),s(l,"return",{value:u(2)}),"function"==typeof Symbol&&s(l,Symbol.iterator,{value:function(){return this}}),l;function u(s){return function(u){var a=[s,u];if(n)throw TypeError("Generator is already executing.");for(;l&&(l=0,a[0]&&(i=0)),i;)try{if(n=1,o&&(r=2&a[0]?o.return:a[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,a[1])).done)return r;switch(o=0,r&&(a=[2&a[0],r.value]),a[0]){case 0:case 1:r=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,o=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!(r=(r=i.trys).length>0&&r[r.length-1])&&(6===a[0]||2===a[0])){i=0;continue}if(3===a[0]&&(!r||a[1]>r[0]&&a[1]<r[3])){i.label=a[1];break}if(6===a[0]&&i.label<r[1]){i.label=r[1],r=a;break}if(r&&i.label<r[2]){i.label=r[2],i.ops.push(a);break}r[2]&&i.ops.pop(),i.trys.pop();continue}a=t.call(e,i)}catch(e){a=[6,e],o=0}finally{n=r=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}}}var g=function(e){function t(){var e;return s(this,t),e=l(this,t,arguments),f(e,"section","preferences"),f(e,"sort",300),f(e,"label","Switch role"),e}return d(t,e),p(t,[{key:"prepare",value:function(){return i(function(){var e,t,o,r,i,l,s,u;return w(this,function(a){return i=Array.isArray(null==(e=this.context.user)?void 0:e.roles)?this.context.user.roles:[],l=null==(o=this.context.acl)||null==(t=o.data)?void 0:t.roleMode,s=this.context.api.auth.role,u=function(e){if(Array.isArray(e))return n(e)}(i)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(i)||b(i)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),"allow-use-union"===l&&u.unshift({name:"__union__",title:this.context.t("Full permissions",{ns:"@nocobase/plugin-acl"})}),this.options=u.map(function(e){return{value:e.name,label:e.title||e.name}}),this.value=s||(null==(r=this.options[0])?void 0:r.value),this.ready=this.options.length>1&&"only-use-union"!==l,[2]})}).call(this)}},{key:"onChange",value:function(e){return i(function(){return w(this,function(t){switch(t.label){case 0:return this.context.api.auth.setRole(e),[4,this.context.api.resource("users").setDefaultRole({values:{roleName:e}})];case 1:return t.sent(),window.location.reload(),[2]}})}).call(this)}}]),t}(e.UserCenterSelectItemModel);f(g,"itemId","switch-role");var P=function(n){function o(){return s(this,o),l(this,o,arguments)}return d(o,n),p(o,[{key:"load",value:function(){return i(function(){var n;return w(this,function(o){return n=this,Object.entries(t).forEach(function(e){var t,o=function(e){if(Array.isArray(e))return e}(e)||function(e){var t,n,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var r=[],i=!0,l=!1;try{for(o=o.call(e);!(i=(t=o.next()).done)&&(r.push(t.value),2!==r.length);i=!0);}catch(e){l=!0,n=e}finally{try{i||null==o.return||o.return()}finally{if(l)throw n}}return r}}(e)||b(e,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),r=o[0],i=o[1];n.app.i18n.addResources(r,(null==(t=n.options)?void 0:t.packageName)||"@nocobase/plugin-acl",i)}),this.app.use(e.ACLRolesCheckProvider),this.app.flowEngine.registerModels({UIEditorTopbarActionModel:e.UIEditorTopbarActionModel,SwitchRoleItemModel:g}),[2]})}).call(this)}}]),o}(v(e.Plugin))}(),u}()});
|
|
10
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("@nocobase/client-v2")):"function"==typeof define&&define.amd?define("@nocobase/plugin-acl/client-v2",["@nocobase/client-v2"],t):"object"==typeof exports?exports["@nocobase/plugin-acl/client-v2"]=t(require("@nocobase/client-v2")):e["@nocobase/plugin-acl/client-v2"]=t(e["@nocobase/client-v2"])}(self,function(e){return function(){"use strict";var t={485:function(t){t.exports=e}},n={};function o(e){var r=n[e];if(void 0!==r)return r.exports;var i=n[e]={exports:{}};return t[e](i,i.exports,o),i.exports}o.d=function(e,t){for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.r=function(e){"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.g.importScripts&&(r=o.g.location+"");var r,i=o.g.document;if(!r&&i&&(i.currentScript&&"SCRIPT"===i.currentScript.tagName.toUpperCase()&&(r=i.currentScript.src),!r)){var l=i.getElementsByTagName("script");if(l.length)for(var s=l.length-1;s>-1&&(!r||!/^http(s?):/.test(r));)r=l[s--].src}if(!r)throw Error("Automatic publicPath is not supported in this browser");o.p=r.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/");var u={};return!function(){var e="",t="u">typeof document?document.currentScript:null;if(t&&t.src&&(e=t.src.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/")),!e){var n=window.__webpack_public_path__||"";n&&("/"!==n.charAt(n.length-1)&&(n+="/"),e=n+"static/plugins/@nocobase/plugin-acl/dist/client-v2/")}if(!e){if(!(e=window.__nocobase_public_path__||"")&&window.location&&window.location.pathname){var r=window.location.pathname||"/",i=r.indexOf("/v2/");e=i>=0?r.slice(0,i+1):"/"}e&&(e=e.replace(/\/v2\/?$/,"/")),e||(e="/"),"/"!==e.charAt(e.length-1)&&(e+="/"),e+="static/plugins/@nocobase/plugin-acl/dist/client-v2/"}o.p=e}(),!function(){o.r(u),o.d(u,{default:function(){return P}});var e=o(485),t={"en-US":JSON.parse('{"Allow roles union":"Allow roles union","Allow users to use role union, which means they can use permissions from all their roles simultaneously, or switch between individual roles.":"Allow users to use role union, which means they can use permissions from all their roles simultaneously, or switch between individual roles.","Data sources":"Data sources","Desktop menu":"Desktop menu","Do not use role union. Users need to switch between their roles individually.":"Do not use role union. Users need to switch between their roles individually.","Force users to use only role union. They cannot switch between individual roles.":"Force users to use only role union. They cannot switch between individual roles.","Full permissions":"Full permissions","General":"General","Independent roles":"Independent roles","New role":"New role","Permissions":"Permissions","Please select role mode":"Please select role mode","Plugin settings":"Plugin settings","Role mode":"Role mode","Role mode doc":"https://docs.nocobase.com/handbook/acl/manual","Roles & Permissions":"Roles & Permissions","Roles union only":"Roles union only","Saved successfully":"Saved successfully","The current user has no roles. Please try another account.":"The current user has no roles. Please try another account.","The user role does not exist. Please try signing in again":"The user role does not exist. Please try signing in again"}'),"zh-CN":JSON.parse('{"Allow roles union":"允许角色并集","Allow users to use role union, which means they can use permissions from all their roles simultaneously, or switch between individual roles.":"允许用户使用角色并集,即可以同时使用自己拥有的所有角色的权限,也允许用户逐个切换自己的角色。","Data sources":"数据源","Desktop menu":"桌面端菜单","Do not use role union. Users need to switch between their roles individually.":"不使用角色并集,用户需要逐个切换自己拥有的角色。","Force users to use only role union. They cannot switch between individual roles.":"强制用户仅能使用角色并集,不能逐个切换角色。","Full permissions":"全部权限","General":"通用","Independent roles":"独立角色","New role":"新建角色","Permissions":"权限","Please select role mode":"请选择角色模式","Plugin settings":"插件设置","Role mode":"角色模式","Role mode doc":"https://docs-cn.nocobase.com/handbook/acl/manual","Roles & Permissions":"角色和权限","Roles union only":"仅角色并集","Saved successfully":"保存成功","The current user has no roles. Please try another account.":"当前用户没有角色,请使用其他账号。","The user role does not exist. Please try signing in again":"用户角色不存在,请尝试重新登录。"}')};function n(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n<t;n++)o[n]=e[n];return o}function r(e,t,n,o,r,i,l){try{var s=e[i](l),u=s.value}catch(e){n(e);return}s.done?t(u):Promise.resolve(u).then(o,r)}function i(e){return function(){var t=this,n=arguments;return new Promise(function(o,i){var l=e.apply(t,n);function s(e){r(l,o,i,s,u,"next",e)}function u(e){r(l,o,i,s,u,"throw",e)}s(void 0)})}}function l(e,t,n){return t=h(t),function(e,t){var n;if(t&&("object"==((n=t)&&"u">typeof Symbol&&n.constructor===Symbol?"symbol":typeof n)||"function"==typeof t))return t;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e,m()?Reflect.construct(t,n||[],h(e).constructor):t.apply(e,n))}function s(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}function a(e,t,n){return(a=m()?Reflect.construct:function(e,t,n){var o=[null];o.push.apply(o,t);var r=new(Function.bind.apply(e,o));return n&&y(r,n.prototype),r}).apply(null,arguments)}function c(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function p(e,t,n){return t&&c(e.prototype,t),n&&c(e,n),e}function f(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function h(e){return(h=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function d(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&y(e,t)}function y(e,t){return(y=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function b(e,t){if(e){if("string"==typeof e)return n(e,t);var o=Object.prototype.toString.call(e).slice(8,-1);if("Object"===o&&e.constructor&&(o=e.constructor.name),"Map"===o||"Set"===o)return Array.from(o);if("Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return n(e,t)}}function v(e){var t="function"==typeof Map?new Map:void 0;return(v=function(e){if(null===e||-1===Function.toString.call(e).indexOf("[native code]"))return e;if("function"!=typeof e)throw TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return a(e,arguments,h(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),y(n,e)})(e)}function m(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(m=function(){return!!e})()}function w(e,t){var n,o,r,i={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]},l=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),s=Object.defineProperty;return s(l,"next",{value:u(0)}),s(l,"throw",{value:u(1)}),s(l,"return",{value:u(2)}),"function"==typeof Symbol&&s(l,Symbol.iterator,{value:function(){return this}}),l;function u(s){return function(u){var a=[s,u];if(n)throw TypeError("Generator is already executing.");for(;l&&(l=0,a[0]&&(i=0)),i;)try{if(n=1,o&&(r=2&a[0]?o.return:a[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,a[1])).done)return r;switch(o=0,r&&(a=[2&a[0],r.value]),a[0]){case 0:case 1:r=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,o=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!(r=(r=i.trys).length>0&&r[r.length-1])&&(6===a[0]||2===a[0])){i=0;continue}if(3===a[0]&&(!r||a[1]>r[0]&&a[1]<r[3])){i.label=a[1];break}if(6===a[0]&&i.label<r[1]){i.label=r[1],r=a;break}if(r&&i.label<r[2]){i.label=r[2],i.ops.push(a);break}r[2]&&i.ops.pop(),i.trys.pop();continue}a=t.call(e,i)}catch(e){a=[6,e],o=0}finally{n=r=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}}}var g=function(e){function t(){var e;return s(this,t),e=l(this,t,arguments),f(e,"section","preferences"),f(e,"sort",300),f(e,"label","Switch role"),e}return d(t,e),p(t,[{key:"prepare",value:function(){return i(function(){var e,t,o,r,i,l,s,u;return w(this,function(a){return i=Array.isArray(null==(e=this.context.user)?void 0:e.roles)?this.context.user.roles:[],l=null==(o=this.context.acl)||null==(t=o.data)?void 0:t.roleMode,s=this.context.api.auth.role,u=function(e){if(Array.isArray(e))return n(e)}(i)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(i)||b(i)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),"allow-use-union"===l&&u.unshift({name:"__union__",title:this.context.t("Full permissions",{ns:"@nocobase/plugin-acl"})}),this.options=u.map(function(e){return{value:e.name,label:e.title||e.name}}),this.value=s||(null==(r=this.options[0])?void 0:r.value),this.ready=this.options.length>1&&"only-use-union"!==l,[2]})}).call(this)}},{key:"onChange",value:function(e){return i(function(){return w(this,function(t){switch(t.label){case 0:return this.context.api.auth.setRole(e),[4,this.context.api.resource("users").setDefaultRole({values:{roleName:e}})];case 1:return t.sent(),window.location.reload(),[2]}})}).call(this)}}]),t}(e.UserCenterSelectItemModel);f(g,"itemId","switch-role");var P=function(n){function o(){return s(this,o),l(this,o,arguments)}return d(o,n),p(o,[{key:"load",value:function(){return i(function(){var n;return w(this,function(o){return n=this,Object.entries(t).forEach(function(e){var t,o=function(e){if(Array.isArray(e))return e}(e)||function(e){var t,n,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var r=[],i=!0,l=!1;try{for(o=o.call(e);!(i=(t=o.next()).done)&&(r.push(t.value),2!==r.length);i=!0);}catch(e){l=!0,n=e}finally{try{i||null==o.return||o.return()}finally{if(l)throw n}}return r}}(e)||b(e,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),r=o[0],i=o[1];n.app.i18n.addResources(r,(null==(t=n.options)?void 0:t.packageName)||"@nocobase/plugin-acl",i)}),this.app.use(e.ACLRolesCheckProvider),this.app.flowEngine.registerModels({UIEditorTopbarActionModel:e.UIEditorTopbarActionModel,SwitchRoleItemModel:g}),[2]})}).call(this)}}]),o}(v(e.Plugin))}(),u}()});
|
package/dist/externalVersion.js
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
module.exports = {
|
|
11
|
-
"@nocobase/client": "2.1.0-beta.
|
|
11
|
+
"@nocobase/client": "2.1.0-beta.32",
|
|
12
12
|
"antd": "5.24.2",
|
|
13
13
|
"react": "18.2.0",
|
|
14
14
|
"react-i18next": "11.18.6",
|
|
@@ -17,16 +17,16 @@ module.exports = {
|
|
|
17
17
|
"@formily/react": "2.3.7",
|
|
18
18
|
"@ant-design/icons": "5.6.1",
|
|
19
19
|
"lodash": "4.18.1",
|
|
20
|
-
"@nocobase/utils": "2.1.0-beta.
|
|
21
|
-
"@nocobase/client-v2": "2.1.0-beta.
|
|
22
|
-
"@nocobase/actions": "2.1.0-beta.
|
|
23
|
-
"@nocobase/cache": "2.1.0-beta.
|
|
24
|
-
"@nocobase/database": "2.1.0-beta.
|
|
25
|
-
"@nocobase/server": "2.1.0-beta.
|
|
26
|
-
"@nocobase/acl": "2.1.0-beta.
|
|
27
|
-
"@nocobase/test": "2.1.0-beta.
|
|
20
|
+
"@nocobase/utils": "2.1.0-beta.32",
|
|
21
|
+
"@nocobase/client-v2": "2.1.0-beta.32",
|
|
22
|
+
"@nocobase/actions": "2.1.0-beta.32",
|
|
23
|
+
"@nocobase/cache": "2.1.0-beta.32",
|
|
24
|
+
"@nocobase/database": "2.1.0-beta.32",
|
|
25
|
+
"@nocobase/server": "2.1.0-beta.32",
|
|
26
|
+
"@nocobase/acl": "2.1.0-beta.32",
|
|
27
|
+
"@nocobase/test": "2.1.0-beta.32",
|
|
28
28
|
"@formily/core": "2.3.7",
|
|
29
29
|
"@formily/antd-v5": "1.2.3",
|
|
30
30
|
"antd-style": "3.7.1",
|
|
31
|
-
"@nocobase/flow-engine": "2.1.0-beta.
|
|
31
|
+
"@nocobase/flow-engine": "2.1.0-beta.32"
|
|
32
32
|
};
|
package/package.json
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
"description": "Based on roles, resources, and actions, access control can precisely manage interface configuration permissions, data operation permissions, menu access permissions, and plugin permissions.",
|
|
7
7
|
"description.ru-RU": "На основе ролей, ресурсов и действий система контроля доступа может точно управлять разрешениями на изменение интерфейса, работу с данными, доступ к меню и разрешениями для подключаемых модулей.",
|
|
8
8
|
"description.zh-CN": "基于角色、资源和操作的权限控制,可以精确控制界面配置权限、数据操作权限、菜单访问权限、插件权限。",
|
|
9
|
-
"version": "2.1.0-beta.
|
|
9
|
+
"version": "2.1.0-beta.32",
|
|
10
10
|
"license": "Apache-2.0",
|
|
11
11
|
"main": "./dist/server/index.js",
|
|
12
12
|
"homepage": "https://docs.nocobase.com/handbook/acl",
|
|
@@ -46,5 +46,5 @@
|
|
|
46
46
|
"url": "git+https://github.com/nocobase/nocobase.git",
|
|
47
47
|
"directory": "packages/plugins/acl"
|
|
48
48
|
},
|
|
49
|
-
"gitHead": "
|
|
49
|
+
"gitHead": "659c5efe992da7118d33c768bbd9e837a2c4716f"
|
|
50
50
|
}
|