| 07:35 | RUros[m] | Hi, today i figured that i cannot upload larger files. I tried to upload picture (.jpg) which was 1,5MB large. Page returned with "Oops, something went wrong. Check your browser's developer console for more details. ". Then I resized picture to around 400 kB and upload was successful. I searched for some kind of parameter for max upload size in settings.php but cannot find anything familiar. |
| 07:36 | RUros[m] | In general for pictures i could use drupal module for resizing, but what for other files ? |
| 07:39 | RUros[m] | In settings.php i searched for "max_upload_size (and related: max_post_size)" but unsuccessful. Should these parameters be added manually ? |
| 08:44 | RUros[m] | And I have also made another observation, where i cannot say if I set it properly: I created new user let's say "user 1", where i want to set permision so it can view all assets, but only edit those who are owned by him (user 1). So I set new role with checked permissions. But what happens: If asset is created by other users (like admin user) and ownership in meta is set to "user 1", then "user 1" can view asset but cannot edit it. But if |
| 08:44 | RUros[m] | asset is created by "user 1" then "user 1" can also edit it. |
| 08:46 | RUros[m] | s/if/what/, s/I/is/, s/set it properly/wrong/ |
| 08:47 | RUros[m] | My understanding is that parameter "Owners" in Meta tab defines this. But like seems this not work in that way. Did I miss something ? |
| 08:50 | RUros[m] | So conclusion: if asset is created by antoher user, then "user 1" cannot edit it, although owner is set to "user 1" in meta tab of this asset. |
| 09:20 | symbioquine[m] | <RUros[m]> "Hi, today i figured that i..." <- If you're still using NGINX, you probably need to set `client_max_body_size 20M;` (or whatever the desired max size is if 20 MB is to large/small) |
| 09:20 | symbioquine[m] | nginx.org/en/docs/http/ngx_http_core_mod |
| 09:22 | symbioquine[m] | <RUros[m]> "And I have also made another..." <- What groups are you assigning to your users? i.e. `farm_manager`, `farm_viewer`, etc? |
| 09:22 | symbioquine[m] | farmos.org/guide/people/ |
| 10:46 | RUros[m] | for "user 1" assigned role is Viewer (managed) and additional role which i created where i am allowing certain assets to do: create asset, update own asset, delete own asset. |
| 10:50 | symbioquine[m] | <RUros[m]> "So conclusion: if asset is..." <- I think you'd have to write some custom code to control whether users with your group can edit assets where they are the owner. I don't think that comes out-of-the-box with farmOS... |
| 10:52 | mstenta[m] | RUros: yes unfortunately the "edit own asset" permission is not related to the "owner" field :-/ |
| 10:52 | mstenta[m] | The former is a standard Drupal perm related to the original author of the entity |
| 10:52 | mstenta[m] | The latter is a field specific to farmOS |
| 10:53 | mstenta[m] | We need to disambiguate that and add more perms for the owner field I agree |
| 10:54 | mstenta[m] | Perhaps it would be worth changing "edit own asset" to "edit authored asset" or something like that |
| 10:54 | RUros[m] | ok, thank you for explanation. Yes, maybe it is a little confusing 🙈 |
| 10:55 | mstenta[m] | Yes it is |
| 10:59 | RUros[m] | So my "user 1" must be the creator of an asset to be able to edit it, right ? What can I do if already have assets, but were not created by him ? |
| 11:11 | symbioquine[m] | Some interesting references. still trying to wrap my head around this...... (full message at <matrix.org/oftc/media/v1/media/download/>) |
| 11:13 | symbioquine[m] | So I think I'm understanding that the comment in A is referring to the "owner" base field added at B, not the "owner" field added in C... |
| 11:13 | symbioquine[m] | What I don't see is why those can both be added with apparently the same name 🧐 |
| 11:14 | symbioquine[m] | (Maybe a dumb question, I might just need more tea to see it... 😅) |
| 11:14 | symbioquine[m] | * So I think I'm understanding that the comment in A is referring to the "owner" base field added at B (by the code in D), not the "owner" field added in C... |
| 11:42 | mstenta[m] | Not a dumb question... it's super confusing |
| 11:42 | mstenta[m] | There are two base fields: uid and owner |
| 11:43 | mstenta[m] | uid is the "owner" from Drupal's perspective, aka author, owner is the one we added to represent "asset/log ownership" |
| 11:43 | symbioquine[m] | I see the uid one here: github.com/farmOS/farmOS/blob/f8eccce1e4 |
| 11:44 | mstenta[m] | Here is the link: github.com/farmOS/farmOS/blob/f8eccce1e4 |
| 11:45 | symbioquine[m] | Ah, so that creates the mapping that D is pulling from when it creates the "owner" (author) base field. |
| 11:45 | mstenta[m] | Yep |
| 11:45 | mstenta[m] | If we take away the owner field that farmOS added, we would still be left with A, B, and D |
| 11:45 | symbioquine[m] | Whereas C doesn't do any mapping and actually creates a field with the key of literally owner |
| 11:46 | mstenta[m] | Exactly |
| 11:46 | symbioquine[m] | 🤦♂️ |
| 11:46 | mstenta[m] | We chose to call owner "Owner" because it makes more sense from a user's perspective |
| 11:46 | symbioquine[m] | Thanks for walking me through that. |
| 11:46 | mstenta[m] | IMO Drupal's "owner" should be "author" |
| 11:47 | mstenta[m] | All of this is hidden in the code, and the only place it really reveals itself to site admins/users is in the permissions |
| 11:48 | mstenta[m] | (and the ambiguity of the word "own") |
| 11:48 | mstenta[m] | In the permissions, "own" means "author" |
| 11:49 | mstenta[m] | We could try to disambiguate by changing the permission names |
| 11:49 | mstenta[m] | But it would probably mean overriding/replacing a bunch of core code |
| 11:51 | mstenta[m] | And it would be a breaking change |
| 11:51 | mstenta[m] | I would love to figure out a plan though... it's been in the back of my mind for a long time |
| 11:52 | symbioquine[m] | Could just be a matter of documenting that under development and linking to it from some strategic comments in the source. |
| 11:52 | mstenta[m] | We don't really use uid for anything... it's mostly just there as a way of tracking who the original author was. |
| 11:52 | mstenta[m] | So maybe we can hijack the permissions and just rewire stuff to use owner instead |
| 11:53 | symbioquine[m] | mstenta[m]: It sounds like that would be in the direction of what RUros was trying to do. |
| 11:53 | mstenta[m] | But I imagine there is also a case for having permissions for the original author too |
| 11:54 | mstenta[m] | Yea agreed - I think that's what a normal person's expectation would be when they read "edit own assets" :-) |
| 11:54 | mstenta[m] | It would raise questions like: if I create an asset, and assign ownership to someone, can I still view/edit the asset? |
| 11:55 | mstenta[m] | (Hence why some extra "author" permissions may be necessary) |
| 11:56 | symbioquine[m] | Seems like we'd need to have some example use-cases for that sort of restricted permission in hand to say - and to say whether that needs to all be automatic or whether an admin can just come re-assign ownership if someone accidentally gives theirs away. |
| 11:57 | mstenta[m] | Yea |
| 11:58 | mstenta[m] | Maybe the first step is to review how the EntityOwnerTrait works and what it adds/does |
| 11:59 | mstenta[m] | This goes a bit beyond Drupal core too, FYI... the entity module (www.drupal.org/project/entity) is responsible for providing all the permissions for custom entity types IIRC |
| 11:59 | mstenta[m] | (It probably also looks for EntityOwnerTrait) |
| 12:07 | mstenta[m] | (Can we get an LLM to read this chat and start a forum topic for us? 😆) |
| 12:07 | symbioquine[m] | Ha |
| 12:08 | symbioquine[m] | I was thinking that we should copy it into a forum topic too |
| 12:20 | mstenta[m] | Tried duck.ai but it was crappy |
| 12:21 | mstenta[m] | farmos.discourse.group/t/permissions-and |
| 12:34 | symbioquine[m] | <mstenta[m]> "farmos.discourse.group/t..." <- Added an image version of this chat there too for (possibly) easier reading |
| 12:35 | mstenta[m] | Great! |