(self, request)
Return True if the couch_user of the given request has permission to export data with this filter.
Return True if the couch_user of the given request has permission to export data with this filter.
Return True if the couch_user of the given request has permission to export data with this filter .
def is_location_safe_for_user(self, request):
        """
        Return True if the couch_user of the given request has permission to export data with this filter.
        """
        if request.couch_user.has_permission(
                request.domain, 'access_all_locations'):
            return True
        elif self.can_access_all_locations:
            return False
        elif not self.accessible_location_ids:
            # if accessible_location_ids is empty, then in theory the user could
            # have access to all data if can_access_all_locations was ever set
            # to False. We need to prevent this from ever happening.
            return False
        else:  # It can be restricted by location
            users_accessible_locations = SQLLocation.active_objects.accessible_location_ids(
                request.domain, request.couch_user
            )
            return set(self.accessible_location_ids).issubset(users_accessible_locations)
def is_location_safe_for_user ( self , request ) : if request . couch_user . has_permission ( request . domain , 'access_all_locations' ) : return True elif self . can_access_all_locations : return False elif not self . accessible_location_ids : # if accessible_location_ids is empty, then in theory the user could # have access to all data if can_access_all_locations was ever set # to False. We need to prevent this from ever happening. return False else : # It can be restricted by location users_accessible_locations = SQLLocation . active_objects . accessible_location_ids ( request . domain , request . couch_user ) return set ( self . accessible_location_ids ) . issubset ( users_accessible_locations )