Skip to content

Conversation

@fahrigedik
Copy link
Member

PermissionGuard now supports redirecting to a specified URL when access is denied and a redirectUrl is provided in route data. Updated guard logic to use map instead of filter/tap, and added corresponding unit tests to verify redirect behavior.

Description

Resolves #24272 (write the related issue number if available)

How to test it?

you have to change branch issue-24272 on abp
you have to change branch rel-10.0 on volo
you have to change branch rel-5.0 on lepton
you must test it volo demo app on lepton repository. this location => lepton\aspnet-core\volo\demo

  1. Open your app.routes.ts file. on angular folder
  2. Add the redirectUrl property to the data object of a route protected by permissionGuard.
   {
     path: 'saas',
     loadChildren: () => import('@volo/abp.ng.saas').then(c => c.createRoutes()),
     canActivate: [permissionGuard],
     data: {
       redirectUrl: '/audit-logs' // The URL to redirect to if permission is denied
     }
   },
  1. Log in with a user who does not have the required permission for the saas route (e.g., Saas.Tenants).
  2. Navigate to the /saas/editions URL.
  3. Result: You should be automatically redirected to /audit-logs instead of seeing the default 403 error page.

PermissionGuard now supports redirecting to a specified URL when access is denied and a redirectUrl is provided in route data. Updated guard logic to use map instead of filter/tap, and added corresponding unit tests to verify redirect behavior.
@yagmurcelk yagmurcelk merged commit 36e4ee0 into rel-10.0 Nov 28, 2025
2 of 3 checks passed
@yagmurcelk yagmurcelk deleted the issue-24272 branch November 28, 2025 12:37
@yagmurcelk yagmurcelk restored the issue-24272 branch November 28, 2025 12:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants