示例#1
0
def get_permissions(user):
    permission_dict = get_member_permissions(user)
    permission_dict.update(
        {
            "can_create_groups": Permissions.can_manage_electee_progress(user),
            "can_edit_resources": Permissions.can_manage_electee_progress(user),
        }
    )
    return permission_dict
示例#2
0
def get_permissions(user):
    permission_dict = get_member_permissions(user)
    permission_dict.update({
        'can_create_groups':
        Permissions.can_manage_electee_progress(user),
        'can_edit_resources':
        Permissions.can_manage_electee_progress(user),
    })
    return permission_dict
示例#3
0
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
示例#4
0
def get_permissions(user):
    permission_dict=get_member_permissions(user)
    is_member=False
    if hasattr(user,'userprofile') and user.userprofile.is_member():
        is_member=True
    permission_dict.update({'can_create_thread':Permissions.can_create_thread(user),
                            'can_create_forum':Permissions.can_create_forum(user),
                            'can_comment':hasattr(user,'userprofile') and user.userprofile.is_member(),
                            'can_moderate':Permissions.can_create_forum(user),
                            'can_downvote':get_user_points(user.userprofile.memberprofile)>0 if is_member else False})
    
    return permission_dict
示例#5
0
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
示例#6
0
def get_permissions(user):
    permission_dict = get_member_permissions(user)
    is_member = False
    can_downvote = False
    if hasattr(user, 'userprofile') and user.userprofile.is_member():
        is_member = True
        can_downvote = get_user_points(user.userprofile.memberprofile) > 0

    permission_dict.update({
                'can_create_thread': Permissions.can_create_thread(user),
                'can_create_forum': Permissions.can_create_forum(user),
                'can_comment': is_member,
                'can_moderate': Permissions.can_create_forum(user),
                'can_downvote': can_downvote
    })
    return permission_dict
示例#7
0
def get_permissions(user):
    permission_dict=get_member_permissions(user)
    return permission_dict
示例#8
0
def get_permissions(user):
    permission_dict = get_member_permissions(user)
    permission_dict.update({
        'can_create_elections': user.is_superuser,
        })
    return permission_dict