Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Returned rejected permission is not always string #324

Closed
Mioleris opened this issue Aug 30, 2016 · 0 comments
Closed

Returned rejected permission is not always string #324

Mioleris opened this issue Aug 30, 2016 · 0 comments
Labels

Comments

@Mioleris
Copy link

Hi, why when [except] anonymous permission is triggered rejected permission is array ['anonymous'] but not string 'anonymous'. (ok that array also triggers [anonymous] action when there is only one item). When [only] admin permission is triggered rejected permission is string 'admin' but not array ['admin] as [except]. When i'm trying to go deeper in states [except] returns ['anonymous', 'anonymous'] and [redirectTo] [default] action is triggered but not [anonymous] action. With [only] admin everything is ok it returns string 'admin'. Permissions are set only on main state.

Example:

permissions: {
    only: ['admin'],
    except: ['anonymous'],
    redirectTo: {
        admin: function(rejectedPermission, transitionProperties){
            console.log(rejectedPermission);
        },
        anonymous: function(rejectedPermission, transitionProperties){
            console.log(rejectedPermission);
        },
         default:  function(rejectedPermission, transitionProperties){
            console.log(rejectedPermission);
        }
    }
}
@masterspambot masterspambot changed the title Multiple redirections problem Returned rejected permission is not always string Sep 21, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants