I’m digging through this ticketing option. One thing I can’t figure out is how I limit what roles can scan a ticket. Even when I log in to the event espresso mobile ap with a subscriber login, I can scan a ticket. I’d like to limit that ability to just a couple of roles. How do I do that?
JC, We are releasing a better API very soon. In the meantime you can add this to your espresso-services/events.php file to limit scanning only to administrators:
EDIT:This needs to go after line #51 //Get the role for this user
$caps = get_user_meta($userid, 'wp_capabilities', true);
$roles = array_keys((array)$caps);
//Set this to whatever role is needed to scan tickets
if ($roles[0] == 'administrator'){
//Continue
}else{
die("<?xml version='1.0'?><events><error>4</error><desc>Invalid User Role</desc></events>");
} Hope that helps. Please let us knwo if you need anything else.
Change administrator to editor, dont have both there. The roles build on each other so an Editor can do what a subscriber can, and an Admin can do what an Editor can. So by changing it to Editor, Editors and above have access.
The subscribers can still log into the app, but they have no rights to see anything at all, so therefore cannot scan a ticket as they cant get to the events.
The support post ‘Limiting who can scan.’ is closed to new replies.
Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.