gcb_web_auth/backends/oauth.py
def verify_user_belongs_to_group(self, duke_unique_id, group_name):
        """
        Using the singleton GroupManagerConnection object check to see if a user belongs to a group and raises
        PermissionDenied if missing setup or user is not a member of the group.
        :param duke_unique_id: str: unique duke id for a user
        :param group_name: str: name of the group to check
        """
        group_manager_connection = GroupManagerConnection.objects.first()
        if not group_manager_connection:
            logger.error(MISSING_GROUP_MANAGER_SETUP)
            raise PermissionDenied(MISSING_GROUP_MANAGER_SETUP)
        if not user_belongs_to_group(group_manager_connection, duke_unique_id, group_name):
            raise PermissionDenied(USER_NOT_IN_GROUP_FMT.format(group_name))

        Using the singleton GroupManagerConnection object check to see if a user belongs to a group and raises
        PermissionDenied if missing setup or user is not a member of the group.
        :param duke_unique_id: str: unique duke id for a user
        :param group_name: str: name of the group to check
        
Using the singleton GroupManagerConnection object check to see if a user belongs to a group and raises
PermissionDenied if missing setup or user is not a member of the group.
Using the singleton GroupManagerConnection object check to see if a user belongs to a group and raises PermissionDenied if missing setup or user is not a member of the group .
def verify_user_belongs_to_group(self, duke_unique_id, group_name):
        group_manager_connection = GroupManagerConnection.objects.first()
        if not group_manager_connection:
            logger.error(MISSING_GROUP_MANAGER_SETUP)
            raise PermissionDenied(MISSING_GROUP_MANAGER_SETUP)
        if not user_belongs_to_group(group_manager_connection, duke_unique_id, group_name):
            raise PermissionDenied(USER_NOT_IN_GROUP_FMT.format(group_name))
def verify_user_belongs_to_group ( self , duke_unique_id , group_name ) : group_manager_connection = GroupManagerConnection . objects . first ( ) if not group_manager_connection : logger . error ( MISSING_GROUP_MANAGER_SETUP ) raise PermissionDenied ( MISSING_GROUP_MANAGER_SETUP ) if not user_belongs_to_group ( group_manager_connection , duke_unique_id , group_name ) : raise PermissionDenied ( USER_NOT_IN_GROUP_FMT . format ( group_name ) )
Using the singleton GroupManagerConnection object check to see if a user belongs to a group and raises
PermissionDenied if missing setup or user is not a member of the group.
Using the singleton GroupManagerConnection object check to see if a user belongs to a group and raises PermissionDenied if missing setup or user is not a member of the group .
"""
        Using the singleton GroupManagerConnection object check to see if a user belongs to a group and raises
        PermissionDenied if missing setup or user is not a member of the group.
        :param duke_unique_id: str: unique duke id for a user
        :param group_name: str: name of the group to check
        """
self
duke_unique_id
unique duke id for a user
unique duke id for a user
group_name
name of the group to check
name of the group to check