Rank: Advanced Member
Groups: HelpDesk, Developers Joined: 11/9/2018(UTC) Posts: 564
Thanks: 122 times Was thanked: 26 time(s) in 25 post(s)
|
I've managed to build some custom admin pages in v9. But I've noticed if the session times out I can't just refresh my custom page to trigger the login page. I have to navigate to an Able page to trigger the login page. Am I missing a decorator or something on my controller?
|
|
|
|
Rank: Administration
Groups: Admin, Administrators, HelpDesk, System, Authorized User, Developers, Registered Joined: 10/5/2018(UTC) Posts: 175
Thanks: 8 times Was thanked: 17 time(s) in 15 post(s)
|
The route you used to register your custom admin pages, please confirm that you specifified the area which must be "admin".
|
|
|
|
Rank: Advanced Member
Groups: HelpDesk, Developers Joined: 11/9/2018(UTC) Posts: 564
Thanks: 122 times Was thanked: 26 time(s) in 25 post(s)
|
I didn't modify routes. I just used the default routing.
for example: http://solunarv9/Admin/Solunar/Index/10745
|
|
|
|
Rank: Administration
Groups: Admin, Administrators, HelpDesk, System, Authorized User, Developers, Registered Joined: 10/5/2018(UTC) Posts: 175
Thanks: 8 times Was thanked: 17 time(s) in 15 post(s)
|
What do you see for the "area" when you enable route debugger on the page you mentioned above? Please confirm your controller extends from AbleAdminController or implements AbleAuthorize attribute.
|
1 user thanked mazhar for this useful post.
|
|
|
Rank: Advanced Member
Groups: HelpDesk, Developers Joined: 11/9/2018(UTC) Posts: 564
Thanks: 122 times Was thanked: 26 time(s) in 25 post(s)
|
Well shoot, I didn't have either one. Thanks for pointing that out.
So I've changed my controller to inherit AbleAdminController instead of Controller. Do I still need to put an AbleAuthorize decorator on every single method in the controller?
|
|
|
|
Rank: Advanced Member
Groups: HelpDesk, Developers Joined: 11/9/2018(UTC) Posts: 564
Thanks: 122 times Was thanked: 26 time(s) in 25 post(s)
|
AHA! That worked - needed to inherit from AbleAdminController thanks Mazhar!!
|
|
|
|
Rank: Administration
Groups: Admin, Administrators, HelpDesk, System, Authorized User, Developers, Registered Joined: 10/5/2018(UTC) Posts: 175
Thanks: 8 times Was thanked: 17 time(s) in 15 post(s)
|
Authorization in MVC is done with the Authorize attribute. We have a custom authorization attribute that is used for the admin area which by default has all admin roles. All admin controllers are expected to be extended from AbleAdminController which also uses AbleAuthorize attribtue. By extending your controller from AbleAdminController you are now using AbleAuthorizeAttribute as well.
|
1 user thanked mazhar for this useful post.
|
|
|
Rank: Advanced Member
Groups: HelpDesk, Developers Joined: 11/9/2018(UTC) Posts: 564
Thanks: 122 times Was thanked: 26 time(s) in 25 post(s)
|
Ok great, that makes perfect sense. Thanks for explaining how that works.
|
|
|
|
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.
Important Information:
The AbleCommerce Forums uses cookies. By continuing to browse this site, you are agreeing to our use of cookies.
More Details
Close