Ejemplo n.º 1
0
 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']
Ejemplo n.º 2
0
 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."
               ))
Ejemplo n.º 3
0
 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.'
               ))
Ejemplo n.º 4
0
    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
Ejemplo n.º 5
0
    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
Ejemplo n.º 6
0
 def _process_args(self, target_category, comment):
     RHManageEventBase._process_args(self)
     self.target_category = target_category
     self.comment = comment
Ejemplo n.º 7
0
 def _process_args(self):
     RHManageEventBase._process_args(self)
     self.obj = get_object_from_args()[2]
     if self.obj is None:
         raise NotFound
Ejemplo n.º 8
0
 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."))
Ejemplo n.º 9
0
 def _checkProtection(self):
     self.ALLOW_LOCKED = self.event_new.can_lock(session.user)
     RHManageEventBase._checkProtection(self)
Ejemplo n.º 10
0
 def _checkProtection(self):
     RHManageEventBase._checkProtection(self)
     if not self.event_new.can_lock(session.user):
         raise Forbidden
Ejemplo n.º 11
0
 def _process_args(self):
     RHManageEventBase._process_args(self)
     self.editable_type = EditableType[request.view_args['type']]
Ejemplo n.º 12
0
 def _check_access(self):
     self.ALLOW_LOCKED = self.event.can_lock(session.user)
     RHManageEventBase._check_access(self)
Ejemplo n.º 13
0
 def _check_access(self):
     RHManageEventBase._check_access(self)
     if not self.event.can_lock(session.user):
         raise Forbidden
Ejemplo n.º 14
0
 def _process_args(self):
     RHManageEventBase._process_args(self)
     self.request = self.event.pending_move_request
     if not self.request:
         raise NotFound
Ejemplo n.º 15
0
 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.'))
Ejemplo n.º 16
0
 def _process_args(self):
     RHManageEventBase._process_args(self)
     self.obj = get_object_from_args()[2]
     if self.obj is None:
         raise NotFound
Ejemplo n.º 17
0
 def _checkParams(self, params):
     RHManageEventBase._checkParams(self, params)
     self.obj = get_object_from_args()[2]
     if self.obj is None:
         raise NotFound
Ejemplo n.º 18
0
 def _check_access(self):
     self.ALLOW_LOCKED = self.event.can_lock(session.user)
     RHManageEventBase._check_access(self)
Ejemplo n.º 19
0
 def _check_access(self):
     RHManageEventBase._check_access(self)
     if not self.event.can_lock(session.user):
         raise Forbidden