Upgrade Your Drupal Skills

We trained 1,000+ Drupal Developers over the last decade.

See Advanced Courses NAH, I know Enough

Module Monday: Role Delay

Parent Feed: 

on January 6, 2014 //

Assign a role to any user after an arbitrary amount of time

It is not uncommon to want to assign a role to a user after they have been a member-in-good-standing of a site for a period of time. Perhaps this role will grant them access to do some content moderation, or gain access to new features like voting on posts. The Role Delay module was created for just this purpose, and it fulfills its 'role' admirably.

Picture of the the Protected Pages email screen

On installation the Role Delay module adds a field to the role edit form which allows the user to specify an arbitrary delay after which this role will be added. This delay can be specified in any format that strtotime() recognizes, which makes it enormously flexible. You can set a different delay for each role if needed, to allow permissions to be gradually assigned over time. Once a delay is set, it will appear next to the role in the role listing screen.

Picture of the Protected Pages password screen

One thing the module does not do is assign these roles to users that already exist in the system, so if you add it to a site and want to assign the role retroactively you will have to script that yourself. Beyond that, Role Delay works well and is a great addition to many community sites.

Greg Dunlap

Senior Drupal Architect

Want Greg Dunlap to speak at your event? Contact us with the details and we’ll be in touch soon.

Author: 
Original Post: 

About Drupal Sun

Drupal Sun is an Evolving Web project. It allows you to:

  • Do full-text search on all the articles in Drupal Planet (thanks to Apache Solr)
  • Facet based on tags, author, or feed
  • Flip through articles quickly (with j/k or arrow keys) to find what you're interested in
  • View the entire article text inline, or in the context of the site where it was created

See the blog post at Evolving Web

Evolving Web