Rearrange role numbers?

brianpeat - February 3, 2007 - 05:15
Project:Front Page
Version:5.x-1.8
Component:Miscellaneous
Category:support request
Priority:normal
Assigned:Dublin Drupaller
Status:active
Description

I have a setup where users have several roles such as local student, distance student, and then all the class names (so I can limit access to different class materials using roles as the limiter).

The problem is, I want the local students to have one front page, the distance another. But the way this module works, if the user has more than one role, it takes the first role...and this is NOT based alphabetically...in fact, I can't tell WHAT system it uses, but it does display a series of numbers, one for each role. Is there a way to change those numbers? And if not, could this module be modified to allow me to choose which roles it will deal with, ignoring other roles I choose to have it ignore?

#1

Dublin Drupaller - February 3, 2007 - 10:51
Assigned to:Anonymous» Dublin Drupaller

Hiya brianpeat...

The system for front page by role type is as follows:

Note:When using the front pages by role option, please note that if a user has multiple roles the first role match will determine which front page they see. Here is the order that the roles will be checked (from left to right).

5 student | 4 distance | 3 team | 2 authenticated user | 1 anonymous user |

The default setting for new roles is SAME AS AUTHENTICATED USERS.

So reading from left to right, the module is checking each role type by the order the role was created in reverse. The most recent role is checked first and the number refers to the $role_id for each role type.

I think it's a good idea to allow users to override that, by entering in their own order.

Probably the simplest way to do it would be to insert a text field where site admins could insert a custom order, using the role IDs seperated by commas, such as:

custom order: 3,5,4,2,1

3 team | 5 student | 4 distance | 2 authenticated user | 1 anonymous user |

I'm busy at the moment so let me know how urgent you need that feature and/or suggest a patch so it can be applied to the module.

Dub

#2

brianpeat - February 3, 2007 - 15:39

It's not urgent as they haven't actually approved this project (I'm just testing to see if Drupal can do what I need it to do, and it appears that it can).

But yes, the ability to rearrange the order would be nice. You might also change the wording on that sentence. There's an entire paragraph of roles in mine, so when it says "left to right" it's kind of confusing.

your comment of "the module is checking each role type by the order the role was created in reverse" makes more sense than "left to right"

Anyway, while it's not urgent, I'd still love to see this done in the next few weeks if possible.

thanks!

#3

brianpeat - February 3, 2007 - 21:33

actually, I realized (thankfully) that my special student roles were added LAST, so they WERE being read first. I had just missed that last field where I needed to change node to front_page, so for now there's definately no hurry on new features for this module.

I do notice ONE peculiar thing about it though (maybe it's a feature). If you have anything else promoted to the front page, (like a block) it will push that block right up against the custom front page. I found I had to put
tags in to push it down. No biggie though, I suppose it's better to have to add space than to not be able to remove it in a pinch. Thanks for a cool module!

#4

frerin - July 19, 2007 - 13:25
Version:5.x-1.6» 5.x-1.8

It would be great to be able to resort the role numbers!

#5

rick.archibald - February 22, 2008 - 20:54

We're using the ldap_integration module against Active Directory, and creating roles on the fly based on the OU's in Active Directory. As the organizational hierarchy changes, it creates additional roles, but not necessarily in the proper order. If we were able to sort the order or, better yet, place a weight on each role, our users would see a customized page for their most unique role. For example, my roles coming from Active Directory are "Employee", "Staff", "Business Services", and "IT Staff". With a weighting in place, I could give the "IT Staff" role the highest weight, on down the line to the "Employee" role having the lowest weight.

#6

jonjonz - March 28, 2008 - 19:56

We are using the front page module as we set up our next generation library web site. At this point we would like to be able to control access as follows:

  • unauthorized users - the public web home page
  • authorized users - staff/intranet home page
  • web author teams (multiple) - staff authorized to create content in separate subject areas.

We would like staff to be greeted with a generic staff only page with links then to the various web author teams pages.

So we would like all staff to be members of the staff group, and then each staff could also be a member of a specific web author team.

The lack of any control on the role assignment order by the front page module limits the modules usefullness. I see there have been several other requests here for some control of the front page role assignment.

Is there any possibility this could be added to the module in the near future?

Otherwise we will have to try some other less desirable work around or make do. We are mainly librarians and users, not coders, so it is unlikely we could modify the code ourselves.

#7

emilyf - June 4, 2008 - 15:31

subscribing

#8

emilyf - June 4, 2008 - 15:39

imce does a nice job of sorting roles, perhaps it would be possible to use a chunk of that code? I don't think I'm skilled enough to do it, but I am hoping the time it would take can be reduced if you reuse some of imce's code.

#9

IngusNeilands - September 15, 2008 - 14:35

subscribing

#10

Dublin Drupaller - September 17, 2008 - 06:12

im updating the module at the moment. will try and include this functionality.

#11

LXNdR - September 24, 2008 - 11:14

subscribing

#12

jmcclelland - May 13, 2009 - 17:28

It's not exactly elegant, but I've attached a quick and dirty patch to provide admins with the ability to order the roles.

You have to enter a space separate listed of role ids.

The patch is written for the Drupal 5 version of front_page.

jamie

AttachmentSize
front_page.module.role-order.patch 4.21 KB

#13

Phillip Mc - May 13, 2009 - 17:44

That's a good idea for Drupal 5.x. Role weights is available for drupal 6.x which might be a simpler solution.

http://drupal.org/project/roleweight

 
 

Drupal is a registered trademark of Dries Buytaert.