def ValidateAccessAndSubjects(requested_access, subjects):
 if (not requested_access):
  raise access_control.UnauthorizedAccess(('Must specify requested access type for %s' % subjects))
 for s in requested_access:
  if (s not in 'rwq'):
   raise ValueError(('Invalid access requested for %s: %s' % (subjects, requested_access)))
 if (('q' in requested_access) and ('r' not in requested_access)):
  raise access_control.UnauthorizedAccess(('Invalid access request: query permissions require read permissions for %s' % subjects), requested_access=requested_access)
 return True

def ValidateAccessAndSubjects ( requested_access , subjects ) : if ( not requested_access ) : raise access_control . UnauthorizedAccess ( ( 'Must specify requested access type for %s' % subjects ) ) for s in requested_access : if ( s not in 'rwq' ) : raise ValueError ( ( 'Invalid access requested for %s: %s' % ( subjects , requested_access ) ) ) if ( ( 'q' in requested_access ) and ( 'r' not in requested_access ) ) : raise access_control . UnauthorizedAccess ( ( 'Invalid access request: query permissions require read permissions for %s' % subjects ) , requested_access = requested_access ) return True
does basic requested access validation .