예제 #1
0
 def _checkProtection( self ):
     if isinstance(self._file.getOwner(), Reviewing):
         selfcopy = copy(self)
         selfcopy._target = self._file.getOwner().getContribution()
         if not (RCContributionPaperReviewingStaff.hasRights(selfcopy) or \
             selfcopy._target.canUserSubmit(self.getAW().getUser()) or \
             self._target.canModify( self.getAW() )):
             raise AccessError()
     else:
         RHDisplayBaseProtected._checkProtection( self )
예제 #2
0
 def _checkProtection( self ):
     if isinstance(self._file.getOwner(), Reviewing):
         selfcopy = copy(self)
         selfcopy._target = self._file.getOwner().getContribution()
         if not (RCContributionPaperReviewingStaff.hasRights(selfcopy) or \
             selfcopy._target.canUserSubmit(self.getAW().getUser()) or \
             self._target.canModify( self.getAW() )):
             raise AccessError()
     else:
         RHDisplayBaseProtected._checkProtection( self )
예제 #3
0
    def _checkProtection(self):
        owner = self._material.getOwner()

        # Conference submitters have access
        if isinstance(owner, conference.Conference
                      ) and owner.getAccessController().canUserSubmit(
                          self._aw.getUser()):
            return

        # There are two exceptions to the normal permission scheme:
        # (sub-)contribution submitters and session coordinators

        # in case the owner is a (sub-)contribution, we should
        # allow submitters
        if isinstance(owner, conference.Contribution) or \
           isinstance(owner, conference.SubContribution):

            reviewingState = self._material.getReviewingState()

            if (reviewingState < 3
                    and  # it means the papers has not been submitted yet (or not reviewing material)
                    owner.canUserSubmit(self._aw.getUser())):
                # Submitters have access
                return
            # status = 3 means the paper is under review (submitted but not reviewed)
            # status = 2 means that the author has not yet submitted the material
            elif isinstance(
                    owner, conference.Contribution
            ) and RCContributionPaperReviewingStaff.hasRights(
                    self, contribution=owner,
                    includingContentReviewer=False) and reviewingState in [
                        2, 3
                    ]:
                return
            elif owner.getSession() and \
                     owner.getSession().canCoordinate(self._aw, "modifContribs"):
                # Coordinators of the parent session have access
                return

        # if it's associated with a session, coordinators
        # should be allowed
        elif self._material.getSession() != None and \
            self._material.getSession().canCoordinate(self._aw):
            # Session coordinators have access
            return

        try:
            ProtectedModificationService._checkProtection(self)
        except ModificationError:
            raise ServiceAccessError(
                _("you are not authorised to manage material "
                  "for this contribution"))
예제 #4
0
    def _checkProtection(self):
        if isinstance(self._file.getOwner(), Reviewing):
            selfcopy = copy(self)
            selfcopy._target = self._file.getOwner().getContribution()
            if not (RCContributionPaperReviewingStaff.hasRights(selfcopy) or \
                selfcopy._target.canUserSubmit(self.getAW().getUser()) or \
                self._target.canModify( self.getAW() )):
                raise AccessError()
        elif isinstance(self._file.getOwner(), Registrant) and \
             not self._file.getOwner().canUserModify(self.getAW().getUser()):
            raise AccessError(_("Access to this resource is forbidden."))

        else:
            RHDisplayBaseProtected._checkProtection(self)
예제 #5
0
    def _checkProtection( self ):
        if isinstance(self._file.getOwner(), Reviewing):
            selfcopy = copy(self)
            selfcopy._target = self._file.getOwner().getContribution()
            if not (RCContributionPaperReviewingStaff.hasRights(selfcopy) or \
                selfcopy._target.canUserSubmit(self.getAW().getUser()) or \
                self._target.canModify( self.getAW() )):
                raise AccessError()
        elif isinstance(self._file.getOwner(), Registrant) and \
             not self._file.getOwner().canUserModify(self.getAW().getUser()):
            raise AccessError(_("Access to this resource is forbidden."))

        else:
            RHDisplayBaseProtected._checkProtection( self )
예제 #6
0
    def _checkProtection(self):
        owner = self._material.getOwner()

        # Conference submitters have access
        if isinstance(owner, conference.Conference) and owner.getAccessController().canUserSubmit(self._aw.getUser()):
            return

        # There are two exceptions to the normal permission scheme:
        # (sub-)contribution submitters and session coordinators

        # in case the owner is a (sub-)contribution, we should
        # allow submitters
        if isinstance(owner, conference.Contribution) or isinstance(owner, conference.SubContribution):

            reviewingState = self._material.getReviewingState()

            if (
                reviewingState < 3
                and owner.canUserSubmit(  # it means the papers has not been submitted yet (or not reviewing material)
                    self._aw.getUser()
                )
            ):
                # Submitters have access
                return
            # status = 3 means the paper is under review (submitted but not reviewed)
            # status = 2 means that the author has not yet submitted the material
            elif (
                isinstance(owner, conference.Contribution)
                and RCContributionPaperReviewingStaff.hasRights(
                    self, contribution=owner, includingContentReviewer=False
                )
                and reviewingState in [2, 3]
            ):
                return
            elif owner.getSession() and owner.getSession().canCoordinate(self._aw, "modifContribs"):
                # Coordinators of the parent session have access
                return

        # if it's associated with a session, coordinators
        # should be allowed
        elif self._material.getSession() != None and self._material.getSession().canCoordinate(self._aw):
            # Session coordinators have access
            return

        try:
            ProtectedModificationService._checkProtection(self)
        except ModificationError:
            raise ServiceAccessError(_("you are not authorised to manage material " "for this contribution"))
예제 #7
0
 def _checkProtection(self):
     if not RCContributionPaperReviewingStaff.hasRights(self):
         MaterialDisplayBase._checkProtection(self)
예제 #8
0
 def _checkProtection(self):
     if not RCContributionPaperReviewingStaff.hasRights(self):
         GetMaterialClassesBase._checkProtection(self)
예제 #9
0
 def _checkProtection(self):
     if not RCContributionPaperReviewingStaff.hasRights(self):
         RHManageContributionReviewingBase._checkProtection(self)
예제 #10
0
 def _checkProtection(self):
     if not RCContributionPaperReviewingStaff.hasRights(self):
         GetMaterialClassesBase._checkProtection(self)
예제 #11
0
 def _checkProtection(self):
     if not RCContributionPaperReviewingStaff.hasRights(self):
         MaterialDisplayBase._checkProtection(self)
예제 #12
0
 def _checkProtection(self):
     if not RCContributionPaperReviewingStaff.hasRights(self):
         RHManageContributionReviewingBase._checkProtection(self)
예제 #13
0
 def _checkProtection(self):
     has_pr_rights = RCContributionPaperReviewingStaff.hasRights(self)
     if not self.contrib.can_manage(session.user, 'submit') and not has_pr_rights:
         raise Forbidden
예제 #14
0
 def _checkProtection(self):
     has_pr_rights = RCContributionPaperReviewingStaff.hasRights(self)
     if not self.contrib.can_manage(session.user, 'submit') and not has_pr_rights:
         raise Forbidden