'Remove all the permissions except for the owner and assign the
view permission to the anonymous group'

def set_default_permissions(self):

    remove_object_permissions(self)
    (anonymous_group, created) = Group.objects.get_or_create(name='anonymous')
    if (not anonymous_group):
        raise Exception("Could    not    acquire    'anonymous'    Group.")
    if settings.DEFAULT_ANONYMOUS_VIEW_PERMISSION:
        assign_perm('view_resourcebase', anonymous_group, self.get_self_resource())
        set_geofence_all(self)
    if settings.DEFAULT_ANONYMOUS_DOWNLOAD_PERMISSION:
        assign_perm('download_resourcebase', anonymous_group, self.get_self_resource())
    set_owner_permissions(self)
    if (self.__class__.__name__ == 'Layer'):
        assign_perm('change_layer_data', self.owner, self)
        assign_perm('change_layer_style', self.owner, self)
