#NEWLINE# def get_all_permissions( self , user_obj , obj = None ) : #NEWLINE# #INDENT# if ( ( not user_obj . is_active ) or user_obj . is_anonymous or ( obj is not None ) ) : #NEWLINE# #INDENT# return set ( ) #NEWLINE# #UNINDENT# if ( not hasattr ( user_obj , '_perm_cache' ) ) : #NEWLINE# #INDENT# user_obj . _perm_cache = self . get_user_permissions ( user_obj ) #NEWLINE# user_obj . _perm_cache . update ( self . get_group_permissions ( user_obj ) ) #NEWLINE# #UNINDENT# return user_obj . _perm_cache