本文整理汇总了Python中mig_main.utility.Permissions.can_view_interview_pairings方法的典型用法代码示例。如果您正苦于以下问题:Python Permissions.can_view_interview_pairings方法的具体用法?Python Permissions.can_view_interview_pairings怎么用?Python Permissions.can_view_interview_pairings使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mig_main.utility.Permissions
的用法示例。
在下文中一共展示了Permissions.can_view_interview_pairings方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get_permissions
# 需要导入模块: from mig_main.utility import Permissions [as 别名]
# 或者: from mig_main.utility.Permissions import can_view_interview_pairings [as 别名]
def get_permissions(user):
permission_dict = get_member_permissions(user)
permission_dict.update({
'can_edit_resources':Permissions.can_manage_electee_progress(user),
'can_edit_surveys':Permissions.can_manage_electee_progress(user),
'can_complete_surveys':Permissions.can_complete_electee_survey(user),
'can_submit_background_form':can_submit_background_form(user),
'can_submit_interview_followups':user_is_member(user) and user.userprofile.memberprofile.status.name=='Active',
'can_view_interview_pairings':Permissions.can_view_interview_pairings(user),
'can_view_followups':Permissions.can_see_follow_up(user),
})
return permission_dict
示例2: view_interview_pairings
# 需要导入模块: from mig_main.utility import Permissions [as 别名]
# 或者: from mig_main.utility.Permissions import can_view_interview_pairings [as 别名]
def view_interview_pairings(request):
if not Permissions.can_view_interview_pairings(request.user):
request.session['error_message']='You are not authorized to view interview state'
return get_previous_page(request,alternate='member_resources:index')
interview_shifts = InterviewShift.objects.filter(term=AcademicTerm.get_current_term()).order_by('interviewer_shift__start_time')
template = loader.get_template('electees/view_interviews.html')
context_dict ={
'interviews':interview_shifts,
'subnav':'misc_reqs',
'base':'member_resources/base_member_resources.html',
'can_view_follow_ups':Permissions.can_see_follow_up(request.user),
}
context_dict.update(get_permissions(request.user))
context_dict.update(get_common_context(request))
context = RequestContext(request,context_dict )
return HttpResponse(template.render(context))