schemas/workflow.py
changeset 2501 fa86d99c2c3a
parent 2459 d088d0ff48a1
child 2602 7bfa83772d90
equal deleted inserted replaced
2500:e342a8662c8d 2501:fa86d99c2c3a
     9 _ = unicode
     9 _ = unicode
    10 
    10 
    11 from yams.buildobjs import (EntityType, RelationType, SubjectRelation,
    11 from yams.buildobjs import (EntityType, RelationType, SubjectRelation,
    12                             ObjectRelation, RichString, String)
    12                             ObjectRelation, RichString, String)
    13 from cubicweb.schema import RQLConstraint
    13 from cubicweb.schema import RQLConstraint
    14 from cubicweb.schemas import META_ETYPE_PERMS, META_RTYPE_PERMS
    14 from cubicweb.schemas import META_ETYPE_PERMS, META_RTYPE_PERMS, HOOKS_RTYPE_PERMS
    15 
    15 
    16 class State(EntityType):
    16 class State(EntityType):
    17     """used to associate simple states to an entity type and/or to define
    17     """used to associate simple states to an entity type and/or to define
    18     workflows
    18     workflows
    19     """
    19     """
    73     comment = RichString(fulltextindexed=True)
    73     comment = RichString(fulltextindexed=True)
    74     # get actor and date time using owned_by and creation_date
    74     # get actor and date time using owned_by and creation_date
    75 
    75 
    76 
    76 
    77 class from_state(RelationType):
    77 class from_state(RelationType):
    78     permissions = META_RTYPE_PERMS
    78     permissions = HOOKS_RTYPE_PERMS
    79     inlined = True
    79     inlined = True
    80 class to_state(RelationType):
    80 class to_state(RelationType):
    81     permissions = META_RTYPE_PERMS
    81     permissions = HOOKS_RTYPE_PERMS
    82     inlined = True
    82     inlined = True
       
    83 
    83 class wf_info_for(RelationType):
    84 class wf_info_for(RelationType):
    84     """link a transition information to its object"""
    85     """link a transition information to its object"""
    85     permissions = {
    86     permissions = {
    86         'read':   ('managers', 'users', 'guests',),# RRQLExpression('U has_read_permission O')),
    87         'read':   ('managers', 'users', 'guests',),# RRQLExpression('U has_read_permission O')),
    87         'add':    (), # handled automatically, no one should add one explicitly
    88         'add':    (), # handled automatically, no one should add one explicitly