Enable check_access context when checking wizard access

issue9108
review261041002
This commit is contained in:
Cédric Krier
2020-03-09 18:24:23 +01:00
parent 456c4828c8
commit 2c3ab3a3bd
2 changed files with 14 additions and 12 deletions
+1
View File
@@ -1,3 +1,4 @@
* Enable check_access context when checking wizard access (issue9108)
* Add editable on calendar view
* Add xalign and yalign to group
* Add MultiSelection entry to Dict field
+13 -12
View File
@@ -230,18 +230,19 @@ class Wizard(URLMixin, PoolBase):
if Transaction().user == 0:
return
model = context.get('active_model')
if model:
ModelAccess.check(model, 'read')
groups = set(User.get_groups())
wizard_groups = ActionWizard.get_groups(cls.__name__,
action_id=context.get('action_id'))
if wizard_groups:
if not groups & wizard_groups:
raise UserError('Calling wizard %s is not allowed!'
% cls.__name__)
elif model:
ModelAccess.check(model, 'write')
with Transaction().set_context(_check_access=True):
model = context.get('active_model')
if model:
ModelAccess.check(model, 'read')
groups = set(User.get_groups())
wizard_groups = ActionWizard.get_groups(cls.__name__,
action_id=context.get('action_id'))
if wizard_groups:
if not groups & wizard_groups:
raise UserError('Calling wizard %s is not allowed!'
% cls.__name__)
elif model:
ModelAccess.check(model, 'write')
@classmethod
def create(cls):