Closed (fixed)
Project:
Role Expire
Version:
6.x-1.0
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
27 Feb 2009 at 16:13 UTC
Updated:
16 Mar 2009 at 13:10 UTC
I'm just curious before I start to tie this into what we're doing... Is there a way to make a call (API like) that would say "give this user role xyz and expire in 6 months"? I see that you can do it via the UI and clicking through to user accounts and adding roles for a duration of time (which works really well). I'm just checking that should I do a DB insert into role_expire_admin (for example) that cron will look at it and drop the admin role for whatever user uid i've inserted in there in 6 months?
Thanks
Comments
Comment #1
bdziewierz commentedThere are four API functions that you can use to control expiry dates:
role_expire_add_role($uid, $rid, $expiry_timestamp = NULL);
role_expire_remove_role($uid, $rid);
role_expire_set_expiry_date($uid, $rid, $expiry_timestamp);
role_expire_clear_expiry_date($uid, $rid);
Arguments should be self explanatory. If you need better documentation on that, please let me know, I will try to put together some kind of API doc.
Comment #2
btopro commentedawesome, that's what I was hoping for. Most of them seem to make sense, only question I have is if you clear the expiry date for a role does that keep the role for that user but remove the date it's revoked, treating it as any "normal" user role in the system?
Comment #3
bdziewierz commentedThat's correct. role_expire_clear_expiry_date only clears expiry date keeping the role association intact (User becomces member of the role for indefinate time).
Comment #4
bdziewierz commented