equal
deleted
inserted
replaced
40 description=_('unique identifier used to connect to the application')) |
40 description=_('unique identifier used to connect to the application')) |
41 upassword = Password(required=True) # password is a reserved word for mysql |
41 upassword = Password(required=True) # password is a reserved word for mysql |
42 firstname = String(maxsize=64) |
42 firstname = String(maxsize=64) |
43 surname = String(maxsize=64) |
43 surname = String(maxsize=64) |
44 last_login_time = Datetime(description=_('last connection date')) |
44 last_login_time = Datetime(description=_('last connection date')) |
45 # allowing an email to be the primary email of multiple entities is necessary for |
|
46 # test at least :-/ |
|
47 primary_email = SubjectRelation('EmailAddress', cardinality='??', |
|
48 description=_('email address to use for notification')) |
|
49 in_group = SubjectRelation('CWGroup', cardinality='+*', |
45 in_group = SubjectRelation('CWGroup', cardinality='+*', |
50 constraints=[RQLConstraint('NOT O name "owners"')], |
46 constraints=[RQLConstraint('NOT O name "owners"')], |
51 description=_('groups grant permissions to the user')) |
47 description=_('groups grant permissions to the user')) |
52 |
48 |
53 |
49 |
69 to indicate which is the preferred form.')) |
65 to indicate which is the preferred form.')) |
70 |
66 |
71 class use_email(RelationType): |
67 class use_email(RelationType): |
72 fulltext_container = 'subject' |
68 fulltext_container = 'subject' |
73 |
69 |
|
70 |
74 class use_email_relation(RelationDefinition): |
71 class use_email_relation(RelationDefinition): |
75 """user's email account""" |
72 """user's email account""" |
76 name = "use_email" |
73 name = "use_email" |
77 __permissions__ = { |
74 __permissions__ = { |
78 'read': ('managers', 'users', 'guests',), |
75 'read': ('managers', 'users', 'guests',), |
82 subject = "CWUser" |
79 subject = "CWUser" |
83 object = "EmailAddress" |
80 object = "EmailAddress" |
84 cardinality = '*?' |
81 cardinality = '*?' |
85 composite = 'subject' |
82 composite = 'subject' |
86 |
83 |
87 class primary_email(RelationType): |
84 |
88 """the prefered email""" |
85 class primary_email(RelationDefinition): |
89 __permissions__ = use_email.__permissions__ |
86 """user's primary email""" |
|
87 __permissions__ = { |
|
88 'read': ('managers', 'users', 'guests',), |
|
89 'add': ('managers', RRQLExpression('U has_update_permission S'),), |
|
90 'delete': ('managers', RRQLExpression('U has_update_permission S'),), |
|
91 } |
|
92 subject = "CWUser" |
|
93 object = "EmailAddress" |
|
94 cardinality = '??' |
|
95 constraints= [RQLConstraint('S use_email O')] |
|
96 |
90 |
97 |
91 class prefered_form(RelationType): |
98 class prefered_form(RelationType): |
92 __permissions__ = { |
99 __permissions__ = { |
93 'read': ('managers', 'users', 'guests',), |
100 'read': ('managers', 'users', 'guests',), |
94 # XXX should have update __permissions__ on both subject and object, |
101 # XXX should have update __permissions__ on both subject and object, |