#NEWLINE# def get_group_permissions( self , user_obj , obj = None ) : #NEWLINE# #INDENT# '\n        Returns a set of permission strings that this user has through his/her\n        groups.\n        ' #NEWLINE# if ( user_obj . is_anonymous ( ) or ( obj is not None ) ) : #NEWLINE# #INDENT# return set ( ) #NEWLINE# #UNINDENT# if ( not hasattr ( user_obj , '_group_perm_cache' ) ) : #NEWLINE# #INDENT# if user_obj . is_superuser : #NEWLINE# #INDENT# perms = Permission . objects . all ( ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# perms = Permission . objects . filter ( group__user = user_obj ) #NEWLINE# #UNINDENT# perms = perms . values_list ( 'content_type__app_label' , 'codename' ) . order_by ( ) #NEWLINE# user_obj . _group_perm_cache = set ( [ ( '%s.%s' % ( ct , perms ) ) for ( ct , name ) in perms ] ) #NEWLINE# #UNINDENT# return user_obj . _group_perm_cache