Association between user and farm
The relationship between a user and a farm is defined, at the highest level, by the role that user plays at the farm. The role can be thought of as the verb that ties the user and the farm together. For example, John owns a farm, Jane manages a farm, and Tony works on a farm. Users may play different roles at different farms. These roles correspond to the roles defined in Role-based Access Control. Here are three common use cases where a user would have associations with different farms:
An individual that wishes to become a farm owner will apprentice as a farm manager at someone else’s farm.
A farm worker may be a worker at several different farms throughout a given season.
A certification technician may inspect many farms each year for compliance.
For this reason, it’s important that Lite Farm support the ability for a user to be associated with any number of farms. For each association, the user may have a different role.
Litefarm must support the following multi-role flows:
A user should only need to register once (per email address)
When logging in, active users can choose one of their existing farm associations or to define a new farm and association
When being invited to play a role at a farm, an existing user can add the new role to their existing roles
^ Registration flow
^ Multi-farm log-in flow
^ Receiving an invitation flow
Architectural Guidance
High level architecture guidance
Open Questions
Open Questions | Discussion | Decisions |
---|---|---|
Where should user settings / configurations be held? | It depends. Obviously user-centric configurations such as language should be held on the user. Settings that may vary from role to role, such as permissions to read/write should be stored on the user-farm. Other, farm specific settings such as measuring system* and currency should be stored on the farm settings. |
|
Can a user play more than one role at a single farm? | Depends on our implementation of RBAC. HW: a manager will also want be able to log hours of ‘work’. role might also change over time. What is important is that the primary farm account (i.e the ‘owner’) controls who has access at any given point, and can invite/reject other users from the main farm account. So what would that process look like where a primary farm ‘invites’ people as workers, technicians, researchers, etc, to ‘join their farm team’ in a particular role?
|
|