logo
Welcome to our new AbleCommerce forums. As a guest, you may view the information here. To post to this forum, you must have a registered account with us, either as a new user evaluating AbleCommerce or an existing user of the application. For all questions related to the older version of Gold and earlier, please go to AbleCommerce Gold forum. Please use your AbleCommerce username and password to Login. New Registrations are disabled.

Notification

Icon
Error

Options
Go to last post Go to first unread
Joe Payne2  
#1 Posted : Friday, November 22, 2019 3:05:00 PM(UTC)
Joe Payne2

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?

Wanna join the discussion?! Login to your AbleCommerce Forums forum account. New Registrations are disabled.

mazhar  
#2 Posted : Monday, November 25, 2019 9:35:00 AM(UTC)
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)
The route you used to register your custom admin pages, please confirm that you specifified the area which must be "admin".
Joe Payne2  
#3 Posted : Monday, November 25, 2019 9:52:56 AM(UTC)
Joe Payne2

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
mazhar  
#4 Posted : Friday, November 29, 2019 9:31:16 AM(UTC)
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)
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.
thanks 1 user thanked mazhar for this useful post.
Joe Payne2 on 11/30/2019(UTC)
Joe Payne2  
#5 Posted : Saturday, November 30, 2019 6:29:31 AM(UTC)
Joe Payne2

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?
Joe Payne2  
#6 Posted : Saturday, November 30, 2019 8:20:24 AM(UTC)
Joe Payne2

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!!
mazhar  
#7 Posted : Monday, December 2, 2019 3:16:08 AM(UTC)
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.
thanks 1 user thanked mazhar for this useful post.
Joe Payne2 on 12/2/2019(UTC)
Joe Payne2  
#8 Posted : Monday, December 2, 2019 6:29:14 AM(UTC)
Joe Payne2

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.
Users browsing this topic
Guest
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.