equal
deleted
inserted
replaced
121 else: |
121 else: |
122 rdef = rschema.rdef(self._cw.describe(self.eidfrom)[0], |
122 rdef = rschema.rdef(self._cw.describe(self.eidfrom)[0], |
123 self._cw.describe(self.eidto)[0]) |
123 self._cw.describe(self.eidto)[0]) |
124 rdef.check_perm(self._cw, 'add', fromeid=self.eidfrom, toeid=self.eidto) |
124 rdef.check_perm(self._cw, 'add', fromeid=self.eidfrom, toeid=self.eidto) |
125 |
125 |
|
126 |
|
127 class BeforeDeleteRelationSecurityHook(SecurityHook): |
|
128 __regid__ = 'securitybeforedelrelation' |
|
129 events = ('before_delete_relation',) |
|
130 |
|
131 def __call__(self): |
|
132 nocheck = self._cw.transaction_data.get('skip-security', ()) |
|
133 if (self.eidfrom, self.rtype, self.eidto) in nocheck: |
|
134 return |
|
135 rschema = self._cw.repo.schema[self.rtype] |
|
136 rdef = rschema.rdef(self._cw.describe(self.eidfrom)[0], |
|
137 self._cw.describe(self.eidto)[0]) |
|
138 rdef.check_perm(self._cw, 'add', fromeid=self.eidfrom, toeid=self.eidto) |
|
139 |