本文整理汇总了Python中MaKaC.user.PrincipalHolder类的典型用法代码示例。如果您正苦于以下问题:Python PrincipalHolder类的具体用法?Python PrincipalHolder怎么用?Python PrincipalHolder使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了PrincipalHolder类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _getAnswer
def _getAnswer( self):
ph = PrincipalHolder()
for user in self._userList:
pr = ph.getById(user["id"])
if pr != None:
self._wm.addManager(pr)
return fossilize(self._wm.getManagers())
示例2: _getAnswer
def _getAnswer(self):
ph = PrincipalHolder()
if self._kindOfList == "modification":
self._categ.revokeModification(ph.getById(self._userId))
elif self._kindOfList == "confCreation":
self._categ.revokeConferenceCreation(ph.getById(self._userId))
return self._getControlUserList()
示例3: _getAnswer
def _getAnswer(self):
ph = PrincipalHolder()
for user in self._userList:
if self._kindOfList == "manager":
self._session.grantModification(ph.getById(user["id"]))
elif self._kindOfList == "coordinator":
self._session.addCoordinator(ph.getById(user["id"]))
return self._getSessionChairList()
示例4: _getAnswer
def _getAnswer(self):
ah = PrincipalHolder()
for user in self._userList:
av = ah.getById(user["id"])
if av is None:
raise NoReportError(_("The user with email %s that you are adding does not exist anymore in the database") % user["email"])
self._contribution.grantSubmission(av)
return self._getSubmittersList()
示例5: _getAnswer
def _getAnswer( self):
ph = PrincipalHolder()
pr = ph.getById(self._userId)
if pr != None:
self._wm.removeManager(pr)
elif not self._wm.removeManagerById(self._userId):
raise ServiceError("ER-U0", _("Cannot find user with id %s") % self._userId)
return fossilize(self._wm.getManagers())
示例6: _getAnswer
def _getAnswer(self):
ph = PrincipalHolder()
for user in self._userList:
if self._kindOfList == "modification":
self._categ.grantModification(ph.getById(user["id"]))
elif self._kindOfList == "confCreation":
self._categ.grantConferenceCreation(ph.getById(user["id"]))
return self._getControlUserList()
示例7: _getAnswer
def _getAnswer(self):
ph = PrincipalHolder()
for user in self._userList:
person = ph.getById(user["id"])
if person is None:
raise NoReportError(_("The user with email %s that you are adding does not exist anymore in the database") % user["email"])
if self._kindOfList == "manager":
self._session.grantModification(person)
elif self._kindOfList == "coordinator":
self._session.addCoordinator(person)
return self._getSessionChairList()
示例8: _getAnswer
def _getAnswer(self):
if self._kindOfUser == "pending":
# remove pending email, self._submitterId is an email address
self._contribution.revokeSubmissionEmail(self._submitterId)
else:
ah = PrincipalHolder()
av = ah.getById(self._submitterId)
if av is not None:
# remove submitter
self._contribution.revokeSubmission(av)
else:
raise ServiceError("ERR-U0", _("User does not exist."))
return self._getSubmittersList()