You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I made a library for router5 that uses your library. My library is responsible for private access to certain pages and I would like to extend it so that it can take on roles and restrict / grant access to certain application pages in accordance with them. My library also takes your nodes and recursively marks them private, but that's all I have. I would like to do something similar
importcreateRouter,{PluginFactory,Route}from"router5";importaccessPlugin,{AccessPluginRouter}from"./index";constpath: Route[]=[{name: 'root',path: '/',role: 'public',// transfer the role like this public: true,// or like this},{name: 'admin',path: '/admin',role: 'admin',// transfer the role like thischildren: [{name: 'adminPage',path: '/adminPage',},]},{name: 'moderator',path: '/moderator',role: 'moderator',// transfer the role like thischildren: [{name: 'moderPage',path: '/moderatorPage',},]}];consttest=()=>{constrouter=createRouter(path)router.usePlugin(accessPlugin({log: true})asPluginFactory);(routerasAccessPluginRouter).createPrivateAccess(path);(routerasAccessPluginRouter).checkAccess('admin');// or 'moderator' // either true or 'public' for open accessrouter.start();console.log('plugin test is successful')}test();
so that my plugin captures these roles and works with them. What would you advise me to do?
The text was updated successfully, but these errors were encountered:
Hi, I made a library for router5 that uses your library. My library is responsible for private access to certain pages and I would like to extend it so that it can take on roles and restrict / grant access to certain application pages in accordance with them. My library also takes your nodes and recursively marks them private, but that's all I have. I would like to do something similar
so that my plugin captures these roles and works with them. What would you advise me to do?
The text was updated successfully, but these errors were encountered: