Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeOur CommunityOur CommunityGeneral Discuss...General Discuss...Best way to link module to users rolesBest way to link module to users roles
Previous
 
Next
New Post
8/14/2009 8:55 PM
 

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?

 
New Post
8/14/2009 11:56 PM
 

To minimize the real-time evaluation, how about a custom table or view. If a table rather than a view, schedule a process to update the table as desired - daily, hourly, whatever. Evaluate dates, role membership and anything else pertinent in the scheduled job - do all the heavy lifting there - and just have the results in the table as a 'Y' or 'N.' Columns would be userid and as many roles as needed for various roles. I suppose the table would be built by administrative user input in a config area - adding columns per checked role. When admin alters table, might as well just drop and re-create it. Nothing lost, no history - it's just an encapsulation of current status.

For real-time, there will still be some penalty but it is down to a simple join on the table where something equals 'y' - or a function which looks at that table and returns a Y ... whichever is more performant. I don't know how you'd minimize performance hit more than returning a single character scalar from a single column, joining on userid.


pmgerholdt
 
Previous
 
Next
HomeHomeOur CommunityOur CommunityGeneral Discuss...General Discuss...Best way to link module to users rolesBest way to link module to users roles


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out