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

TransitionRejection error with new version and ui-router 1.0.0.rc-1 #418

Closed
oleg-demkovych opened this issue May 11, 2017 · 6 comments
Closed
Labels

Comments

@oleg-demkovych
Copy link

oleg-demkovych commented May 11, 2017

I have 2 states:
users:

permissions: {
   only: ['canView'],
   redirectTo: 'roles'
}

details:

permissions: {
   only: ['canEdit'],
   redirectTo: 'details'
}

When i login, i have permission canView. When i try open details state from users, i have error from ui-router:

TransitionRejection(type: 2, message: The transition has been superseded by a different transition, detail: Transition#2( 'app.users'{} -> 'app.users'{} ))

@ajayngn
Copy link

ajayngn commented May 15, 2017

I am also facing exactly the same issue........Please help

@masterspambot
Copy link
Collaborator

@olegdemkovych Can you send more complete permission tree? Tests have passed, but maybe I missed a case.

@yaroslavert
Copy link

image

@pns2050
Copy link

pns2050 commented May 17, 2017

Hi,

"angular": "~1.6.4",
"angular-ui-router": "~1.0.3",

PermPermissionStore
        .definePermission('isStudent', function () {
            return angular.isDefined(angular.fromJson($sessionStorage.info)) && angular.fromJson($sessionStorage.info).role === 'student';
        });

    PermPermissionStore
        .definePermission('isTeacher', function () {
            return angular.isDefined(angular.fromJson($sessionStorage.info)) && angular.fromJson($sessionStorage.info).role === 'teacher';
        });
    PermPermissionStore
        .definePermission('isAdmin', function () {
            return angular.isDefined(angular.fromJson($sessionStorage.info)) && angular.fromJson($sessionStorage.info).role === 'admin';
        });
$stateProvider.state('platform', {
        url: "/platform",
        templateUrl: "assets/views/app.html",
        abstract: true,
        data: {
            permissions: {
                only: ['isStudent', 'isTeacher', 'isAdmin'],
                redirectTo: 'login.signin'
            }
        }
    })

Visiting /platform without permissions =>

untitled

@GabrielGil
Copy link

GabrielGil commented May 25, 2017

Exactly the same thing is happening to me.

@masterspambot
Copy link
Collaborator

Gotta think how to solve this issue. Eventually this will land as improvement in ui-router.

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

6 participants