imports/vx/client/code/vxapp.js
/**
     * Determine if this route is authorized for the current user.
     *
     * @return {boolean} True if the current user is authorized for the current route.
     */
Determine if this route is authorized for the current user.
@return {boolean} True if the current user is authorized for the current route.
Determine if this route is authorized for the current user . @return { boolean } True if the current user is authorized for the current route .
isAuthorizedRoute() {
        const meteorUserId = window.localStorage.getItem("Meteor.userId")
        if (VXApp.isAppAuthorizedRoute && VXApp.isAppAuthorizedRoute(meteorUserId)) {
            return !!meteorUserId
        }
        const superAdminRoutes = ["/log", "/events" ]
        const systemAdminRoutes = ["/users-domains", "/domains-users", "/user/", "/domain/", "/tenant/",
            "/functions", "/function/", ]
        const path = Util.routePath()
        if (Util.startsWith(superAdminRoutes, path)) {
            return Util.isUserSuperAdmin(meteorUserId)
        }
        if (Util.startsWith(systemAdminRoutes, path)) {
            return Util.isUserAdmin(meteorUserId)
        }
        return !!meteorUserId
    }
isAuthorizedRoute ( ) { const meteorUserId = window . localStorage . getItem ( "Meteor.userId" ) if ( VXApp . isAppAuthorizedRoute && VXApp . isAppAuthorizedRoute ( meteorUserId ) ) { return ! ! meteorUserId } const superAdminRoutes = [ "/log" , "/events" ] const systemAdminRoutes = [ "/users-domains" , "/domains-users" , "/user/" , "/domain/" , "/tenant/" , "/functions" , "/function/" , ] const path = Util . routePath ( ) if ( Util . startsWith ( superAdminRoutes , path ) ) { return Util . isUserSuperAdmin ( meteorUserId ) } if ( Util . startsWith ( systemAdminRoutes , path ) ) { return Util . isUserAdmin ( meteorUserId ) } return ! ! meteorUserId }
Determine if this route is authorized for the current user.
Determine if this route is authorized for the current user .