User specific route with flow-router (permission)



i created a route /admin with a special view. Now i want only the user with the username “admin” to be able to access this route. How can this be accomplished? Any reference? Do i have to realize this with the roles package or can i check it with an other method?

Hope you can help me.

thank you in advance


Hello @k4r1m,

In Flow Router you can add trigger to handle roles as shown in below link.

For Example

  // calls just before the action
  triggersEnter: [trackRouteEntry],
  action: function() {
    // do something you like
  // calls when when we decide to move to another route
  // but calls before the next route started
  triggersExit: [trackRouteClose]

function trackRouteEntry(context) {
  // context is the output of `FlowRouter.current()`
// Add code to handle role.

function trackRouteClose(context) {
// caled on close

Tarun Sharma
Sr. Developer @ AIMDek Technologies Pvt Ltd
+91 9510657842