

def set_editing(self, permissions, auth=None, log=False):
    'Set the editing permissions for this node.\n\n        :param auth: All the auth information including user, API key\n        :param bool permissions: True = publicly editable\n        :param bool save: Whether to save the privacy change\n        :param bool log: Whether to add a NodeLog for the privacy change\n            if true the node object is also saved\n        '
    node = self.owner
    if (permissions and (not self.is_publicly_editable)):
        if node.is_public:
            self.is_publicly_editable = True
        else:
            raise NodeStateError('Private components cannot be made publicly editable.')
    elif ((not permissions) and self.is_publicly_editable):
        self.is_publicly_editable = False
    else:
        raise NodeStateError('Desired permission change is the same as current setting.')
    if log:
        node.add_log(action=(NodeLog.MADE_WIKI_PUBLIC if self.is_publicly_editable else NodeLog.MADE_WIKI_PRIVATE), params={
            'project': node.parent_id,
            'node': node._primary_key,
        }, auth=auth, save=False)
        node.save()
    self.save()

dataset/ETHPy150Open CenterForOpenScience/osf.io/website/addons/wiki/model.py AddonWikiNodeSettings.set_editing/original