本文整理匯總了Python中MaKaC.webinterface.rh.reviewingModif.RCReferee.hasRights方法的典型用法代碼示例。如果您正苦於以下問題:Python RCReferee.hasRights方法的具體用法?Python RCReferee.hasRights怎麽用?Python RCReferee.hasRights使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類MaKaC.webinterface.rh.reviewingModif.RCReferee
的用法示例。
在下文中一共展示了RCReferee.hasRights方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: _handleGet
# 需要導入模塊: from MaKaC.webinterface.rh.reviewingModif import RCReferee [as 別名]
# 或者: from MaKaC.webinterface.rh.reviewingModif.RCReferee import hasRights [as 別名]
def _handleGet(self):
contributions = self._conf.getContributionList()
filter = {}
# filtering if the active user is a referee: he can only see his own contribs
isOnlyReferee = (
RCReferee.hasRights(self)
and not RCPaperReviewManager.hasRights(self)
and not self._conf.canModify(self.getAW())
)
if isOnlyReferee:
filter["referee"] = self._getUser()
elif self._showWithReferee:
filter["referee"] = "any"
else:
filter["referee"] = None
if self._showWithEditor:
filter["editor"] = "any"
else:
filter["editor"] = None
if self._showWithReviewer:
filter["reviewer"] = "any"
else:
filter["reviewer"] = None
# note by David: I added "if self._selTypes..." and the other ifs after this line,
# in order to make the recording request load contributions work
# but, it may break the paper reviewing module -> assign contributions filter
if self._selTypes:
filter["type"] = self._selTypes
if self._selTracks:
filter["track"] = self._selTracks
if self._selSessions:
filter["session"] = self._selSessions
if self._poster:
filter["poster"] = self._poster
filterCrit = ContributionsReviewingFilterCrit(self._conf, filter)
sortingCrit = contribFilters.SortingCriteria(["number"])
if self._selTypes:
filterCrit.getField("type").setShowNoValue(self._typeShowNoValue)
if self._selTracks:
filterCrit.getField("track").setShowNoValue(self._trackShowNoValue)
if self._selSessions:
filterCrit.getField("session").setShowNoValue(self._sessionShowNoValue)
if self._poster:
filterCrit.getField("poster").setShowNoValue(self._posterShowNoValue)
filterCrit.getField("referee").setShowNoValue(not isOnlyReferee)
f = filters.SimpleFilter(filterCrit, sortingCrit)
contributions = f.apply(contributions)
return DictPickler.pickle(contributions)
示例2: _checkProtection
# 需要導入模塊: from MaKaC.webinterface.rh.reviewingModif import RCReferee [as 別名]
# 或者: from MaKaC.webinterface.rh.reviewingModif.RCReferee import hasRights [as 別名]
def _checkProtection(self):
hasRights = False;
if RCPaperReviewManager.hasRights(self):
hasRights = True
elif RCReferee.hasRights(self):
isRefereeOfAllContributions = True
for contribution in self._contributions:
if not contribution.getReviewManager().isReferee(self.getAW().getUser()):
isRefereeOfAllContributions = False
break
hasRights = isRefereeOfAllContributions
if not hasRights:
ProtectedModificationService._checkProtection(self)
示例3: _handleGet
# 需要導入模塊: from MaKaC.webinterface.rh.reviewingModif import RCReferee [as 別名]
# 或者: from MaKaC.webinterface.rh.reviewingModif.RCReferee import hasRights [as 別名]
def _handleGet(self):
contributions = Contribution.find(event_new=self._conf.as_event, is_deleted=False).options(
joinedload("timetable_entry"), joinedload("paper_reviewing_roles")
)
filter = {}
# filtering if the active user is a referee: he can only see his own contribs
isOnlyReferee = (
RCReferee.hasRights(self)
and not RCPaperReviewManager.hasRights(self)
and not self._conf.canModify(self.getAW())
)
# We want to make an 'or', not an 'and' of the reviewing assign status
filter["reviewing"] = {}
if isOnlyReferee:
filter["reviewing"]["referee"] = self._getUser()
elif self._showWithReferee:
filter["reviewing"]["referee"] = "any"
if self._showWithEditor:
filter["reviewing"]["editor"] = "any"
if self._showWithReviewer:
filter["reviewing"]["reviewer"] = "any"
filter["type"] = self._selTypes
filter["track"] = self._selTracks
filter["session"] = self._selSessions
filter["materialsubmitted"] = self._showWithMaterial
filterCrit = ContributionsReviewingFilterCrit(self._conf, filter)
sortingCrit = contribFilters.SortingCriteria(["number"])
filterCrit.getField("type").setShowNoValue(self._typeShowNoValue)
filterCrit.getField("track").setShowNoValue(self._trackShowNoValue)
filterCrit.getField("session").setShowNoValue(self._sessionShowNoValue)
filterCrit.getField("reviewing").setShowNoValue(self._showWithoutTeam)
filterCrit.getField("materialsubmitted").setShowNoValue(self._showWithoutMaterial)
f = filters.SimpleFilter(filterCrit, sortingCrit)
contributions = f.apply(contributions)
return [_serialize_contribution(contrib) for contrib in contributions]
示例4: _handleGet
# 需要導入模塊: from MaKaC.webinterface.rh.reviewingModif import RCReferee [as 別名]
# 或者: from MaKaC.webinterface.rh.reviewingModif.RCReferee import hasRights [as 別名]
def _handleGet(self):
contributions = self._conf.getContributionList()
filter = {}
#filtering if the active user is a referee: he can only see his own contribs
isOnlyReferee = RCReferee.hasRights(self) \
and not RCPaperReviewManager.hasRights(self) \
and not self._conf.canModify(self.getAW())
# We want to make an 'or', not an 'and' of the reviewing assign status
filter["reviewing"] = {}
if isOnlyReferee:
filter["reviewing"]["referee"] = self._getUser()
elif self._showWithReferee:
filter["reviewing"]["referee"] = "any"
if self._showWithEditor:
filter["reviewing"]["editor"] = "any"
if self._showWithReviewer:
filter["reviewing"]["reviewer"] = "any"
filter["type"] = self._selTypes
filter["track"] = self._selTracks
filter["session"] = self._selSessions
filter["materialsubmitted"] = self._showWithMaterial
filterCrit = ContributionsReviewingFilterCrit(self._conf, filter)
sortingCrit = contribFilters.SortingCriteria(["number"])
filterCrit.getField("type").setShowNoValue(self._typeShowNoValue)
filterCrit.getField("track").setShowNoValue(self._trackShowNoValue)
filterCrit.getField("session").setShowNoValue(self._sessionShowNoValue)
filterCrit.getField("reviewing").setShowNoValue(self._showWithoutTeam)
filterCrit.getField("materialsubmitted").setShowNoValue(self._showWithoutMaterial)
f = filters.SimpleFilter(filterCrit, sortingCrit)
contributions = f.apply(contributions)
return fossilize(contributions, IContributionFossil)
示例5: _checkProtection
# 需要導入模塊: from MaKaC.webinterface.rh.reviewingModif import RCReferee [as 別名]
# 或者: from MaKaC.webinterface.rh.reviewingModif.RCReferee import hasRights [as 別名]
def _checkProtection(self):
if not RCPaperReviewManager.hasRights(self) and not RCReferee.hasRights(self):
RHConferenceModifBase._checkProtection(self)
示例6: _checkProtection
# 需要導入模塊: from MaKaC.webinterface.rh.reviewingModif import RCReferee [as 別名]
# 或者: from MaKaC.webinterface.rh.reviewingModif.RCReferee import hasRights [as 別名]
def _checkProtection(self):
if self._target.hasEnabledSection("paperReviewing"):
if not RCPaperReviewManager.hasRights(self) and not RCReferee.hasRights(self):
RHConferenceModifBase._checkProtection(self);
else:
raise MaKaCError(_("Paper Reviewing is not active for this conference"))
示例7: _checkProtection
# 需要導入模塊: from MaKaC.webinterface.rh.reviewingModif import RCReferee [as 別名]
# 或者: from MaKaC.webinterface.rh.reviewingModif.RCReferee import hasRights [as 別名]
def _checkProtection(self):
if not RCPaperReviewManager.hasRights(self) and not RCReferee.hasRights(self):
ProtectedModificationService._checkProtection(self)