Today @paul121 and I were discussing the need for a new dedicated role in farmOS for “administering farmOS settings”. I’ll try to document the thinking here so we can open this up to feedback/brainstorming…
Context: from the beginning, farmOS has provided three default roles: Manager, Worker, and Viewer. The Manager and Worker roles are very similar - both can view/edit/delete all records, but historically the Manager role has been granted some additional “configuration” permissions. The Viewer role can view all records, but can’t change anything.
Then, in farmOS 2.x we added the “Account Admin” role, with the primary purpose of managing users logins. Managers couldn’t do this, so it was only available to sitewide (Drupal) admins. In Farmier I provided an “Account Admin” role for this purpose, which I then contributed back to core and we merged via this PR: https://github.com/farmOS/farmOS/pull/714
Notably, we also added the administer farm settings
permission to that role, even though it didn’t quite fit the purpose. I noted this in the PR:
this role ALSO adds the
administer farm settings
permission. This is a carry over from Farmier, and it sort of stretches the purpose of this module, so curious if we should rethink that or not. As it stands now, theadminister farm settings
permission is not added to any managed roles, so it’s up to the host to decide who gets it. Feels like it makes sense to be in this “Account Admin” role to me, but open to feedback on that.
This administer farm settings
permission doesn’t make sense to assign to Manager roles, because it grants access to change things like the name of the farmOS instance (the farm name), the system of measurement (imperial/metric), etc. It’s more “admin”-y in that way.
But we don’t have an “admin” role other than Account Admin right now, unless you are self-hosting and you have access to Drupal user 1 - but Farmier does not allow access to that, nor should any “hosted” farmOS service. Hence this forum topic.
The way we currently grant “configuration” permissions to the Manager role is via the config_permissions
option provided by the farm_role
module, which provides our concept of “Managed roles” (roles whose permissions are assigned automatically via PHP logic rather than by manually clicking all the boxes in the Drupal role/permission array).
This shows which permissions are currently assigned to Manager roles that way: Code search results · GitHub
A quick copy+paste at the time of this writing:
access taxonomy overview
access data_stream_notification overview
create data_stream_notification
delete data_stream_notification
update data_stream_notification
view data_stream_notification
administer quantity
access farm import index
access farm report index
administer field_module
administer farm notification
access farm setup
create quick_form
update quick_form
administer quick_form
So maybe the next step here is reviewing those and asking “should Managers have these permissions”?
Another question is: “should we rename the config_permissions
property”? It’s sort of a confusing name… it traces back to this idea that “Managers have more access to configuration than Workers”… which we then split from the “Manager” role specifically in 2.x and made this concept of config_permissions
, which the Manager role received (but others could too potentially). And now we are talking about trying to meet the need for another level… above Manager, for site-wide configuration.
These would be breaking changes, no doubt… and I’m not sure if we have the capacity to make them happen in 4.x, so this might be aspirational. But maybe there’s an elegant solution and everything will fall into place easily! Let’s see what others think.