Add support for locking out new non-admin users from all files
Is your feature request related to a problem? Please describe. I'm running OIDC login, which creates the account on first login. The problem is what that new account can do the moment it exists. Right now a brand new user automatically gets view and download on all the default-enabled sources, so anyone who can reach the login screen with a valid OIDC identity can browse the files right away. I want the opposite: a new user should not see anything at all, and I decide per user what they get to see. The catch is that this has to be the state the account is created with, not something I revoke afterwards, because the account does not exist until the person logs in.
Describe the solution you'd like When the server auto-creates a user (OIDC first login, and the same for the other auto-login methods), that user should start with no source file access: view, download, modify, create and delete all off on every source they get. Admins are the exception and keep full access, including admins who get the role from the OIDC admin group.
After that I just use the admin user panel to grant a user access to the sources I want them to have. The per-user, per-source permission editor already exists and works, so the only missing piece is the starting state of new accounts: locked out instead of open.
Describe alternatives you've considered Setting defaultPermissions to all false in the source config. This mostly works, but it's a global template, so it also applies to users that admins create by hand, and only the first source's value actually gets used. It also breaks the auto-created OIDC admin, who would inherit the deny-all template instead of full admin permissions.
Gating people out with the OIDC user groups. That controls who can log in, not what a logged-in user can see, so it doesn't solve the problem.
Creating the user manually before their first login. Not possible with OIDC, because the login is what creates the account.
Additional context Most of the pieces are already there: per-user source permissions, the admin user editor that changes them, and the admin-group promotion path. What's missing is just one default. The change I have working: at account creation, new non-admin accounts get an explicit deny-all on their source scopes (marked as explicitly set, so it doesn't get silently replaced by later default changes), auto-created admins get the full admin permission set instead of the global template, and when an existing user is promoted into the admin group later, their scopes are upgraded to full access. Happy to open a PR for it.
Source: gtsteffaniak/filebrowser