I’m trying to understand where the permission IDs (codes) come from for the database table oc_filecache.
I had a file with permissions = 19 which behaved as read-only (could be viewed, but not changed, deleted or renamed).
Looking at other files I’ve changed it to permissions = 27 like: update oc_filecache set permissions = 27 where fileid = 559;
After that I could move and delete it.
Now, I see bunch of different values such as 19, 26, 27, 31 but I can’t trace it to neither a code table of some kind, nor could I find any documentation or mention of those in the code repo.
Could someone point me (or just straight tell me) what does each code value stand for? Or where they come from? Are they taken from file system, enforced by some logic, anything.
To explain further, once I am sure which code does what I’d like to change the codes in the oc_filecache table for subsection of the files and folders, making them read-only “protected” archives, accessible to everyone but not allowing anyone to move, delete or change the data in any way. In theory I could just blindly put “19” on everything, but that would be foolish without knowing the bigger picture.
First, I consider it critical to change the values in tables of other apps without understanding the implications of that. The table name suggests it is a file cache. So, it might be updated by e.g. occ files:scan or similar functions.
Having said that, I want to point you to the files app. That can be found in the nextcloud/server repo. There, you should be able to get the root of said table entries.
I guess that this is similar to unix file permissions. You have to convert to binary format in order to read them in a better way. E.g 19 = 16 + 2 + 1 and 26 = 16 + 8 + 2 and 27 = 16 + 8 + 2 + 1. So, 16 seems like readable and 8 might be change or remove or something similar.