def check_view_permissions(self):
        if self.action == 'retrieve':
            result = self.get_access_permissions().can_retrieve(self.request.user)
        elif self.action in ('metadata', 'list'):
            # Every authenticated user can see the metadata and list or
            # retrieve the config. Anonymous users can do so if they are
            # enabled.
            result = self.request.user.is_authenticated() or config['general_system_enable_anonymous']
        elif self.action == 'update':
            result = self.request.user.has_perm('core.can_manage_config')
        else:
            result = False
        return result
Builds a single package object from a specification.
dataset/ETHPy150Open OpenSlides/OpenSlides/openslides/core/views.py/ConfigViewSet.check_view_permissions--crossover with--dataset/ETHPy150Open openstack/sahara/sahara/plugins/images.py/SaharaPackageValidator._package_from_spec