equal
deleted
inserted
replaced
141 in case where the relation has been set through modification of |
141 in case where the relation has been set through modification of |
142 `entity.cw_edited` in a hook |
142 `entity.cw_edited` in a hook |
143 """ |
143 """ |
144 assert rschema.inlined |
144 assert rschema.inlined |
145 try: |
145 try: |
146 entity = cnx.transaction_data['ecache'][eid] |
146 entity = cnx.entity_cache(eid) |
147 except KeyError: |
147 except KeyError: |
148 return False |
148 return False |
149 return rschema.type in entity.cw_edited.skip_security |
149 edited = getattr(entity, 'cw_edited', None) |
|
150 if edited is None: |
|
151 return False |
|
152 return rschema.type in edited.skip_security |
150 |
153 |
151 |
154 |
152 class BeforeAddRelationSecurityHook(SecurityHook): |
155 class BeforeAddRelationSecurityHook(SecurityHook): |
153 __regid__ = 'securitybeforeaddrelation' |
156 __regid__ = 'securitybeforeaddrelation' |
154 events = ('before_add_relation',) |
157 events = ('before_add_relation',) |