Module Monday: Role Delay

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.

Get in touch with us

Tell us about your project or drop us a line. We'd love to hear from you!