Example #1
0
 def _checkProtection(self):
     if not self._target.canModify(
             self.getAW()) and not self._target.canUserSubmit(
                 self.getAW().getUser()):
         if self._target.getModifKey() != "":
             raise ModificationError()
         if self._getUser() == None:
             self._checkSessionUser()
         else:
             raise ModificationError()
Example #2
0
 def _checkProtection(self):
     if not self._target.canModify(self.getAW()):
         if self._target.getModifKey() != "":
             raise ModificationError()
         if self._getUser() is None:
             self._checkSessionUser()
         else:
             raise ModificationError()
     if hasattr(self._target, "getConference") and not self._allowClosed:
         if self._target.getConference().isClosed():
             raise ConferenceClosedError(self._target.getConference())
Example #3
0
 def _checkProtection(self):
     if not self._target.canModify(self.getAW()):
         if self._target.getModifKey() != "":
             raise ModificationError()
         if self._getUser() == None:
             # there is a risk the session was closed during the write
             # process and the minutes will be lost if we do not preserve
             # them
             self._preserveParams()
             # then ask the user to login again
             self._checkSessionUser()
         else:
             raise ModificationError()
Example #4
0
 def _checkProtection(self):
     if isinstance(self._target, Conference):
         can_manage = self._target.as_event.can_manage(session.user,
                                                       role=self.ROLE,
                                                       allow_key=True)
     else:
         can_manage = self._target.canModify(session.avatar)
     if not can_manage:
         if self._target.getModifKey() != "":
             raise ModificationError()
         if self._getUser() is None:
             self._checkSessionUser()
         else:
             raise ModificationError()
     if hasattr(self._target, "getConference") and not self._allowClosed:
         if self._target.getConference().isClosed():
             raise ConferenceClosedError(self._target.getConference())
Example #5
0
 def _checkProtection(self):
     if not self._target.canAccess(self.getAW()):
         from MaKaC.conference import Resource, Category
         if isinstance(self._target, Resource):
             target = self._target.getOwner()
         else:
             target = self._target
         if not isinstance(self._target, Category) and target.isProtected():
             if target.getAccessKey() != "" or target.getConference() and \
                     target.getConference().getAccessKey() != "":
                 raise KeyAccessError()
             elif target.getModifKey() != "" or target.getConference() and \
                     target.getConference().getModifKey() != "":
                 raise ModificationError()
         if self._getUser() is None:
             self._checkSessionUser()
         else:
             raise AccessError()
Example #6
0
    def _checkProtection(self):

        RHProtected._checkProtection(self)
        if not self._avatar.canUserModify(self._getUser()):
            raise ModificationError("user")