How to use `Roles` in `Vue Router`?

router. beforeEach((to, from, next) => {
            // Check user
            if (!Meteor.loggingIn() && !Meteor.userId()) {
                next({path: '/login'});
            } else {
                // Check role
                    let loggedInUser = Meteor.userId();
                    let role = Roles.userIsInRole(loggedInUser, ['posts.insert'], 'Entry');

                    if (role) {
                        next();
                    }else{
                       alert('no role'); 
                   }
            }
    });

It always alert no role

Now I tries

// Method
export const userIsInRole = new ValidatedMethod({
    name: 'userIsInRole',
    mixins: [CallPromiseMixin],
    validate: new SimpleSchema({
        role: {type: String},
    }).validator(),
    run({role}) {
        if (!this.isSimulation) {
            return Roles.userIsInRole(Meteor.userId(), role);
        }
    }
});

---------
// router
router.beforeResolve((to, from, next) => {
            // Check user
            if (!Meteor.loggingIn() && !Meteor.userId()) {
                next({path: '/login'});
            } else {
                userIsInRole.callPromise({role: to.name}).then((result) => {
                    if (result) {
                        next();
                    } else {
                        next(false);
                        alert('no roles');
                    }
                }).catch((err) => {
                    console.log(err.reason);
                });
            }
    });

It work fine, please adviceā€¦