Does anyone have any suggestions on the best way to link a module to users roles?
Basically, we want scott (ventrain) to link properties in his propery agent module to users roles so as soon as the users role expires the property will not be shown in search results?
EXAMPLE:
Jack has joined our site & is a member of the "subscribers role" & his "subscribers role" expires on the 10/10/2009. If he chooses not to resubscribe to the "subscribers role" then his properties will not be displayed after 10/10/2009.
Basically we would need a sql statement like this for search results, & property details (obviously this is a very basic example without all the joins):
select * from properties where usersrole = 3 and usersroleexpiry >= todaysdate
Scott brings up a valid point that users may be part of many roles, so we are unsure how to link the view permissions of each listing to a users role.
The only thing I can think of would be to do a subquery to check for user role permission but this would be a huge preformance issue. Scotts suggestion is to use a scheduled job that runs in the background to keep the user roles & property listings view permissions in synch, but this would not be updated in real time (there would be a delay until the newxt scheduled job was run).
Anyone have any suggestions or ideas?