Skip to content
Snippets Groups Projects
Commit 1ee82b460998 authored by Sylvain Thénault's avatar Sylvain Thénault
Browse files

fix spent_for permissions, use class notation to define the relation

parent bd4d1dc13ff0
No related branches found
No related tags found
No related merge requests found
sync_schema_props_perms('spent_for')
# template's specific schema # template's specific schema
from yams.buildobjs import SubjectRelation from yams.buildobjs import RelationDefinition
from cubicweb.schema import RRQLExpression
...@@ -3,5 +4,10 @@ ...@@ -3,5 +4,10 @@
from cubes.expense.schema import Expense class spent_for(RelationDefinition):
subject = 'Expense'
Expense.add_relation(SubjectRelation('Workcase', cardinality='?*'), object = 'Workcase'
name='spent_for') cardinality = '?*'
__permissions__ = {
'read' : ('managers', 'users'),
'add': ('managers', RRQLExpression('S in_state ST, NOT ST name "accepted"')),
'delete': ('managers', RRQLExpression('S in_state ST, NOT ST name "accepted"')),
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment