Question

Photo of Ken Roach

0

Best way to generate unique codes to control access to resources?

We would like to issue (sell) unique codes to people to give them access to a set of conference resources.  (Probably max 100.)

The easiest way to do this would be to sell pre-printed access cards with a code (e.g. D4F34) and a web page address, e.g. /mysite/conference_resources.
Client would purchase card, go to page, enter code, code would be validated via a workflow, if code passes validation then page with resources would display.

Anyone else done this already?  What is the best way to generate, save and validate the unique code?

Options:

1. Use a workflow/SQL to generate a random string, then insert records into a specific group, with me as the person on each group record, and the code as an attribute, then search the group for the matching attribute during validation. 

2. Add a specific table to the Rock database that contains the list of unique values (fields: unique code, has_been_used).  Use this to validate against.  Would require SQL to generate the table and add the rows.  Need SQL to generate the unique code.  How access the new table to report the values using Rock reports or Merge docs to issue the unique code cards/letters to clients?

3a. Get clients' name at time of purchase, add as Rock member (or update), then set Person attribute flag as 'can access resources.'  Slower.  Creates barrier to purchase.  Needs to be setup with manual effort at busiest time (time of sale), as opposed to pre-generating sale cards.

3b.  Could use the Regstration functionality to get person to enter their own name and email/phone number at time of purchase.  Then use workflow to set their 'can access resources' Person attribute, then invite them to logon, they can then access the Resources page. No need to pre-generate, store or issue access codes.  But it means person has to register at time of purchase.   

4. Use a global attribute.  Generate the string of codes (using excel random function or some other random text generator), and enter the entire set of random codes into the string. E.g. Key: Global_Attribute_Access_Codes, Value: ABC1234 DEF3546 GHJ657).  At time of validation, search for the text in the global attribute.  Probably okay for shorter lists, maybe not best if the number of codes being generated is large.

 5. Others options?

And the best way is....? 

  • Photo of Jim Michael

    0

    If it were me I'd be going with option 3b... and event reg where they pay for it, automatically get added to a group you have set up as a security role which you then use to control access to the resources content. Simple, and we wouldn't really consider it a downside that a person has to "register at time of purchase." That's kind of the norm.