[docs]defset_permissions(project:str,registry:str,staging:str,url:str,owners:Optional[List]=None,uploaders:Optional[Dict]=None,global_write:Optional[bool]=None,append:bool=True):""" Set the owner and uploader permissions for a project. Args: project: Name of the project. registry: Path to the Gobbler registry. staging: Path to the staging directory. url: URL of the REST API. owners: List of user IDs for owners of this project. If None, no change is made to the existing owners in the project permissions. uploaders: List of dictionaries specifying the authorized uploaders for this project. See the ``uploaders`` field in the return value of :py:func:`~.fetch_permissions` for the expected format. If None, no change is made to the existing uploaders. global_write: Whether to enable global writes for this project, see the ``global_write`` field in the return value of :py:func:`~.fetch_permissions` for more details. If None, no change is made to the global write status. append: Whether ``owners`` and ``uploaders`` should be appended to the existing owners and uploaders, respectively. If False, the ``owners`` and ``uploaders`` are used to replace the existing values in the project permissions. """perms={}ifappend:oldperms=fetch_permissions(project,registry=registry,url=url)ifownersisnotNone:oldset=set(oldperms["owners"])perms["owners"]=oldperms["owners"]+list(filter(lambdax:xnotinoldset,owners))ifuploadersisnotNone:perms["uploaders"]=oldperms["uploaders"]+uploaderselse:ifownersisnotNone:perms["owners"]=ownersifuploadersisnotNone:perms["uploaders"]=uploadersifglobal_writeisnotNone:perms["global_write"]=global_writeut.dump_request(staging,url,"set_permissions",{"project":project,"permissions":perms})