equal
deleted
inserted
replaced
66 if perms == (): |
66 if perms == (): |
67 # That means an immutable attribute; as an optimization, avoid |
67 # That means an immutable attribute; as an optimization, avoid |
68 # going through check_perm. |
68 # going through check_perm. |
69 raise Unauthorized(action, str(rdef)) |
69 raise Unauthorized(action, str(rdef)) |
70 rdef.check_perm(cnx, action, eid=eid) |
70 rdef.check_perm(cnx, action, eid=eid) |
|
71 |
|
72 if action == 'add' and not etypechecked: |
|
73 # think about cnx.create_entity('Foo') |
|
74 # the standard metadata were inserted by a hook |
|
75 # with a bypass ... we conceptually need to check |
|
76 # the eid attribute at *creation* time |
|
77 entity.cw_check_perm(action) |
71 |
78 |
72 |
79 |
73 class CheckEntityPermissionOp(hook.DataOperationMixIn, hook.LateOperation): |
80 class CheckEntityPermissionOp(hook.DataOperationMixIn, hook.LateOperation): |
74 def precommit_event(self): |
81 def precommit_event(self): |
75 cnx = self.cnx |
82 cnx = self.cnx |