Restricting Access to Object Data by Account¶
Available Liferay 7.4 U34+/GA34+
In scenarios with multiple business accounts, you may want to restrict access to object entries by account. To do this, your custom object must have an active relationship with the Account system object, and you must configure the custom object to use this relationship for restricting entry data. Once set up, anyone adding entries to the custom object must select an account. This account becomes the entry’s owner, so only account members can access it.
Follow these steps to use accounts to restrict access to custom Object entries:
Open the Global Menu (), go to the Control Panel tab, and click Objects.
Begin editing the Account system object.
Add a One to Many or Many to Many relationship, relating the Account object to the desired custom object. See Defining Object Relationships for more information.
Return to the Objects page and begin editing the desired custom object.
In the Details tab, toggle Account Restriction to active and select the Account relationship you want to use for relating entries.
This adds a new mandatory account selection field to the object, so anyone adding an entry must select an account. Available options are determined by the user’s account memberships. Once set, only members of the selected account can access the entry.