How to do multiple redirections with multiple permissions in angularjs using angular permission library?

188 Views Asked by At

I want to have a route that has multiple permissions, and it can only be accessible if all of them are met and I want a different redirection rule for each of them, somewhat like below:

{
    only: ['loggedin', 'hasProject'],
    redirectTo: {
        loggedin: {
            state: 'login'
        },
        hasProject: {
            state: 'createProject'
        }
    }
}

I checked doc of angular-permission, and it has mentioned that only option works like OR.

Between values in array operator OR is used to create an alternative. If you need AND operator between permissions define additional PermRole containing set of those.

How can I make it work as AND?

0

There are 0 best solutions below