schema.py
changeset 10140 e14ec2aac099
parent 9990 c84ad981fc4a
child 10192 365e5a0287d6
equal deleted inserted replaced
10139:7b99845bd258 10140:e14ec2aac099
   607     clear_cache(self, 'get_rqlexprs')
   607     clear_cache(self, 'get_rqlexprs')
   608     clear_cache(self, 'get_groups')
   608     clear_cache(self, 'get_groups')
   609 PermissionMixIn.set_action_permissions = set_action_permissions
   609 PermissionMixIn.set_action_permissions = set_action_permissions
   610 
   610 
   611 def has_local_role(self, action):
   611 def has_local_role(self, action):
   612     """return true if the action *may* be granted locally (eg either rql
   612     """return true if the action *may* be granted locally (i.e. either rql
   613     expressions or the owners group are used in security definition)
   613     expressions or the owners group are used in security definition)
   614 
   614 
   615     XXX this method is only there since we don't know well how to deal with
   615     XXX this method is only there since we don't know well how to deal with
   616     'add' action checking. Also find a better name would be nice.
   616     'add' action checking. Also find a better name would be nice.
   617     """
   617     """
  1136 
  1136 
  1137 
  1137 
  1138 class RQLVocabularyConstraint(BaseRQLConstraint):
  1138 class RQLVocabularyConstraint(BaseRQLConstraint):
  1139     """the rql vocabulary constraint:
  1139     """the rql vocabulary constraint:
  1140 
  1140 
  1141     limit the proposed values to a set of entities returned by a rql query,
  1141     limits the proposed values to a set of entities returned by an rql query,
  1142     but this is not enforced at the repository level
  1142     but this is not enforced at the repository level
  1143 
  1143 
  1144      `expression` is additional rql restriction that will be added to
  1144     `expression` is an additional rql restriction that will be added to
  1145      a predefined query, where the S and O variables respectivly represent
  1145     a predefined query, where the S and O variables respectively represent
  1146      the subject and the object of the relation
  1146     the subject and the object of the relation
  1147 
  1147 
  1148      `mainvars` is a set of variables that should be used as selection variable
  1148     `mainvars` is a set of variables that should be used as selection variables
  1149      (eg `'Any %s WHERE ...' % mainvars`). If not specified, an attempt will be
  1149     (i.e. `'Any %s WHERE ...' % mainvars`). If not specified, an attempt will be
  1150      done to guess it according to variable used in the expression.
  1150     made to guess it based on the variables used in the expression.
  1151     """
  1151     """
  1152 
  1152 
  1153     def repo_check(self, session, eidfrom, rtype, eidto):
  1153     def repo_check(self, session, eidfrom, rtype, eidto):
  1154         """raise ValidationError if the relation doesn't satisfy the constraint
  1154         """raise ValidationError if the relation doesn't satisfy the constraint
  1155         """
  1155         """