This is a very similar case of the previous example, Single agency with different permissions and access levels.
Now we have two or more agencies, but every agent should only see and edit properties and customers that belong to his agency.
First of all we have to create an access level for every agency:
As you can see we added the groups related to the ACME agency, plus the Super Users ones, too; in this way users that have admin permissions will be able to see those records.
In the following examples, you can see it in action: we set the access of a property to ACME agency and only the users that are allowed (in other words: the users that belong to one of the groups we specified for that access level) will see the record in the property list.
If an agent of another agency tries to perform a search or to browse the properties, he simply won't see the record: it's completely hidden to him.
However we could have a little problem with new records: the agents cannot change the access level, but we want it to be defined to a specific one. For example properties belonging to the ACME agency should have the corresponding access level (ACME agency).
We can achieve this using the Properties default access level and Customers default access level fields inside the agency profile.
In this way, every time an agent creates a record, it will receive the access level of the agency; said in other words, this means that that record will be visible to employees of his agency.
In this latest example, we reached one of most complex scenario: we have several agencies and agents will be able to edit and see only records that belong to their own agency. This mean that agent of ACME agency will only see and edit properties and customers of the ACME agency, while they can't see nor edit properties or customers of the RE agency.
In order to do that, we created an access level for every agency, assigning the groups of the agencies inside that. After that, we defined default access levels, so every new record will have the same access level.