Default page per role on sign-in

This is a forum to suggest new features for mojoPortal. 

This thread is closed to new posts. You must sign in to post in the forums.
10/2/2011 4:39:03 AM
Gravatar
Total Posts 537
feet planted firmly on the ground

Default page per role on sign-in

I have a couple of sites where I'd like users in certain roles to arrive at specific pages when they sign in. This may for example be a page of simple instructions, or it may contain a custom feature. I'd love to be able to configure this default page against the role.

Of course any one user can be a member of more than one role, so there could be conflicting directives. I think this could be coped with by setting up the default pages in the "Site Settings" area: a tab allowing default pages to be set in order (rank), with each page having one or more roles associated with it. This would make it easy to set up for the site, and easy to see how the rules would play out if a user is in more than one group.

There would then be a little logic on signing in, for example if the user had arrived at a bookmarked restricted page that was not the default (therefore bouncing to the sign-in page) I think this should trump the default, because it shows clear intent by the user. But where user just signing in normally, they would go the default.

(or is there a way of achieving all of this already...?)

 

 

 

10/2/2011 10:50:15 AM
Gravatar
Total Posts 18439

Re: Default page per role on sign-in

Hi Crispin,

I think you could do this by implementing a custom UserSignIn Event handler. You could check if there is a referring url/return url and if not then do a hard redirect based on your own logic.

Alternatively, since by default if there is no return url the user would be redirected to the home page, and you could implement a custom feature on your home page that redirects based on some custom logic, maybe you could set a session cookie indicating that you did the redirect if you still want the user to be able to come back to the home page if he chooses.

I don't really see this as something that will be implemented directly in mojoPortal, or at least not in the near term.

Best,

Joe

10/2/2011 11:21:46 AM
Gravatar
Total Posts 537
feet planted firmly on the ground

Re: Default page per role on sign-in

OK thanks Joe - I see we can roll this ourselves - it just seemed like perhaps it would be a common request.

Another idea... if sign in goes to the "home" page (assuming no returnURL) could I make different "home" pages that are visible to the different roles?   How does mojo decide the home page - is it just the first page in the list?

cheers

10/2/2011 11:33:00 AM
Gravatar
Total Posts 18439

Re: Default page per role on sign-in

home page is nothing special, it is no different than any other page, it is merely the root level page with the lowest sort order. you could move any page to the home page position and it would become the home page. So, no there is not a way to make different home pages for different users. 

Best,

Joe

10/2/2011 11:46:58 AM
Gravatar
Total Posts 537
feet planted firmly on the ground

Re: Default page per role on sign-in

OK I've tested this and you are right - if I hide homepage1 from a role (this being the first root level page) a user in this role gets "Sorry, you are not allowed to view this content...". I was hoping they might arrive at homepage2 (being the second root level page, which this role can see).

Would it be hard to make "home" evaluate to "the root level page with the lowest sort order that is visible to the user" ?  That would float my boat!

 

 

10/2/2011 12:01:02 PM
Gravatar
Total Posts 18439

Re: Default page per role on sign-in

sorry but no, we are not redirecting to a specific page we are just redirecting to the root of the site which by definition happens to be the home page, ie http://yoursite/ or http://yoursite/default.aspx

trying to lookup what the lowest sort order root level page the user is allowed to view is not something I want to build in. We generally don't look up user permissions in the database, we just check the current page allowed roles against the user role cookie, doing that in the database would be much less efficient.

This is not something that has been requested before and it seems like a niche need to me. Its the kind of thing one might do if one were building a social networking site you might want to redirect the user to his own page but mojoPortal is specifically not for that.

My advice would be to instead think in terms of showing or hiding things on the home page based on roles. Say the home page view permissions are for all users, therefore all users can get to the url for the home page, but you add instances of Html content features on the page with more specific roles (view roles on the content instances) they will not be shown if the user is not in an allowed role, therefore you can taylor the home page content by roles.

Best,

Joe

10/2/2011 1:56:55 PM
Gravatar
Total Posts 537
feet planted firmly on the ground

Re: Default page per role on sign-in

Hi Joe

Yes that should work out OK, and thanks for taking the time to consider this.  (It's certainly not a social networking site - far too many of them already imho!  the current job is a portal for managing and accessing specialist datasets to help environmentally friendly farming and land management).

 

10/2/2011 2:02:32 PM
Gravatar
Total Posts 18439

Re: Default page per role on sign-in

Sounds like a good project. If you implement it as a custom feature then you could load different data from within the feature depending on the roles of the user who is viewing the page in addition to or as an alternative to showing and hiding different instances based on roles.

Best,

Joe

You must sign in to post in the forums. This thread is closed to new posts.