raiseInvenioWebAccessFireroleError("Error while compiling rule %s (line %s): %s is a reserved key and can not be used in FireRole rules!"%(row,line,field))
raiseInvenioWebAccessFireroleError("Syntax error while compiling rule %s (line %s): %s is not a valid date with format YYYY-MM-DD because %s!"%(row,line,expr,msg))
raiseInvenioWebAccessFireroleError("Syntax error while compiling rule %s (line %s): %s is not a valid ip group because %s!"%(row,line,expr,msg))
else:
expressions_list.append((False,expr[1:-1]))
expressions_list=tuple(expressions_list)
iffieldin('from','until'):
iflen(expressions_list)!=1:
raiseInvenioWebAccessFireroleError("Error when compiling rule %s (line %s): exactly one date is expected when using 'from' or 'until', but %s were found"%(row,line,len(expressions_list)))
ifnot_p:
raiseInvenioWebAccessFireroleError("Error when compiling rule %s (line %s): 'not' is not allowed when using 'from' or 'until'"%(row,line))
emails=run_sql("SELECT user.email FROM usergroup JOIN user_usergroup ON usergroup.id=user_usergroup.id_usergroup JOIN user ON user.id=user_usergroup.id_user WHERE usergroup.name=%s",(expr,))
foremailinemails:
authorized_emails.add(email[0].lower().strip())
eliffield=='email':
forreg_p,exprinexpressions_list:
ifreg_p:
continue
authorized_emails.add(expr.lower().strip())
eliffield=='uid':
forreg_p,exprinexpressions_list:
ifreg_p:
continue
email=run_sql("SELECT email FROM user WHERE id=%s",(expr,))