Skip to content
This repository has been archived by the owner on May 2, 2020. It is now read-only.

Allow custom preroutes or more options for permissions based viewing #591

Closed
codingfriend1 opened this issue Jun 11, 2017 · 3 comments
Closed

Comments

@codingfriend1
Copy link

I need to be able to selectively load routes based on a user's role or permission. For instance only admin's can load the edit-users page, or only user's with a permission of 'create-page' can go to the create-new-page page.

Could you create a way to allow us to override custom preroutes? Perhaps calling your current preroutes method as a helper?

@scriptPilot
Copy link
Owner

@codingfriend1 - Get that point. I add is as feature request.

@miner150000
Copy link

miner150000 commented Aug 12, 2017

Meanwhile you could use the Dynamic routing for this purpose as you could send a boolean depending on the user's permissions.

Example:
User A permission root
User B permission non-root

Routes { "path": "/create-page/:permission/", "component": "createPage.vue" },

then Test User permission and link accordingly
if (user.permission==="root"){ window.f7.mainView.loadPage('/create-page/true'); else{window.f7.mainView.loadPage(/create-page/false)}

not perfect and very enhanceable but you get the point.

@scriptPilot
Copy link
Owner

scriptPilot pushed a commit that referenced this issue Oct 27, 2017
@scriptPilot scriptPilot removed the prio label Oct 27, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants