Creative commons Attribution-NonCommercial license.
NO WARRANTY IS GIVEN OR IMPLIED, USE AT YOUR OWN RISK.
Check if the given token is allocated the specified role. Returns the personId
if the person associated with this token does have the specified role.
Returning the personId instead of true or false is slightly clunky, however
in many cases it is saving having to do two separate queries against the
database, which is a minor performance optimisation.
Check if the given token is allocated the specified role.
- Returns the personId if this person is allocated this role, otherwise returns 0.
"select distinct t.person_uuid "+
"from token t join role r on (t.token=? and t.person_uuid=r.person_uuid and r.role=? and r.resource is null and r.uid is null)");