def _process_args(self): RHManageEventBase._process_args(self) args = parser.parse({ 'values': PrincipalDict(allow_groups=True, allow_external_users=True, allow_event_roles=True, allow_category_roles=True, event_id=self.event.id, missing={}) }) self.values = args['values']
def _checkParams(self, params): RHManageEventBase._checkParams(self, params) self.target_category = Category.get_one(int( request.form['target_category_id']), is_deleted=False) if not self.target_category.can_create_events(session.user): raise Forbidden( _("You may only move events to categories where you are allowed to create events." ))
def _process_args(self): RHManageEventBase._process_args(self) self.target_category = Category.get_or_404(int( request.form['target_category_id']), is_deleted=False) if not self.target_category.can_create_events(session.user): raise Forbidden( _('You may only move events to categories where you are allowed to create events.' ))
def _check_access(self): if not session.user: raise Forbidden # If the user cannot manage the whole event see if anything gives them # limited management access. if not self.event.can_manage(session.user): urls = sorted(values_from_signal(signals.event_management.management_url.send(self.event), single_value=True)) response = redirect(urls[0]) if urls else None raise Forbidden(response=response) RHManageEventBase._check_access(self) # mainly to trigger the legacy "event locked" check
def _check_access(self): if not session.user: raise Forbidden # If the user cannot manage the whole event see if anything gives them # limited management access. if not self.event.can_manage(session.user): urls = sorted(values_from_signal(signals.event_management.management_url.send(self.event), single_value=True)) response = redirect(urls[0]) if urls else None raise Forbidden(response=response) RHManageEventBase._check_access(self) # mainly to trigger the legacy "event locked" check
def _process_args(self, target_category, comment): RHManageEventBase._process_args(self) self.target_category = target_category self.comment = comment
def _process_args(self): RHManageEventBase._process_args(self) self.obj = get_object_from_args()[2] if self.obj is None: raise NotFound
def _process_args(self): RHManageEventBase._process_args(self) self.target_category = Category.get_one(int(request.form['target_category_id']), is_deleted=False) if not self.target_category.can_create_events(session.user): raise Forbidden(_("You may only move events to categories where you are allowed to create events."))
def _checkProtection(self): self.ALLOW_LOCKED = self.event_new.can_lock(session.user) RHManageEventBase._checkProtection(self)
def _checkProtection(self): RHManageEventBase._checkProtection(self) if not self.event_new.can_lock(session.user): raise Forbidden
def _process_args(self): RHManageEventBase._process_args(self) self.editable_type = EditableType[request.view_args['type']]
def _check_access(self): self.ALLOW_LOCKED = self.event.can_lock(session.user) RHManageEventBase._check_access(self)
def _check_access(self): RHManageEventBase._check_access(self) if not self.event.can_lock(session.user): raise Forbidden
def _process_args(self): RHManageEventBase._process_args(self) self.request = self.event.pending_move_request if not self.request: raise NotFound
def _check_access(self): RHManageEventBase._check_access(self) if (not self.target_category.can_create_events(session.user) and not self.target_category.can_propose_events(session.user)): raise Forbidden(_('You may not move events to this category.'))
def _process_args(self): RHManageEventBase._process_args(self) self.obj = get_object_from_args()[2] if self.obj is None: raise NotFound
def _checkParams(self, params): RHManageEventBase._checkParams(self, params) self.obj = get_object_from_args()[2] if self.obj is None: raise NotFound
def _check_access(self): self.ALLOW_LOCKED = self.event.can_lock(session.user) RHManageEventBase._check_access(self)
def _check_access(self): RHManageEventBase._check_access(self) if not self.event.can_lock(session.user): raise Forbidden