I have a shared computer and user in our organization and for security and privacy reasons want to automatically delete the folder and files after I sign out from the NextCloud client.
and then when I sign in back start syncing with the server.
Question isn’t entirely clear, so I’m going to GUESS that you’re referring to the “nextcloud application” being installed on some workstation, and that you want all files synchronized to it to be deleted when its disconnected?
In terms of security, deleting files automatically won’t be of any benefit, because (1) the process responsible for deleting files can be stopped, and (2) the operating system won’t securely delete files – they may still be available to be recovered. Especially if the disk is magnetic.
Consequently, you do NOT want to be using a synchronization client, the whole purpose of which is to maintain a duplicate copy of files on the server. As @devnull suggested, consider webdav instead and access it as a remote filesystem. HOWEVER, even this isn’t going to be a great benefit for security, since whatever programs access those files may create temporary files that can be recovered.
IMO, your best bet is not to share computers (computers are cheap anyway), and to use filesystem encryption.
it sounds not right for me if the user needs to setup the Nextcloud client, sync the files just to work for some time on specific client and then needs to log out from the Nextcloud client… Maybe connecting WebDAV as remote share works better for you? so files never hit the PC?
In general non-admin users should have no read/write rights to other users directory. By default Nextcloud files are stored in user’s application directory - so other users have no access to it. It is more or less safe to keep the files on the client - only the disk space may become a problem if you have many users and files.