Restricting Display and Editing to Content Created by Members of the Same Group
Overview
While it is possible to restrict the groups that can view and edit content through permission settings in content definitions, for dynamic settings like "members of the same group," custom function using triggers is required.
In this tutorial, using the Visibility of content in Admin panel trigger, restrictions are set in content definitions so that only content created by members of the same group can be displayed and edited.
What You Will Learn
In this tutorial, you will learn how to set restrictions so that only content created by members of the same group can be displayed and edited by following the steps below.
Set up custom function
Click [Operations] -> [Custom function].
Click [Add].
Set up the custom function as follows:
Field | Value |
---|---|
Title | fiter_members_of_the_same_group |
Identifier | fiter_members_of_the_same_group |
Trigger | Visibility of content in Admin panel / Specify the target content definition ID |
Processing | The following content |
loading...
Once you have entered the information, click [Add] to add the custom function.
Verify the operation
To verify the functionality, prepare test members and groups as follows:
Member | Group |
---|---|
Diverta Hanako | Tester |
Diverta Jiro | Editor |
Diverta Taro | Editor |
Next, log in with each member and create one content each.
The Visibility of content in Admin panel trigger is executed when logged in as a user other than the "super user," allowing the super user to view all content.
Finally, log in with each member and check the displayed content in the list. You will see that only content created by members of the same group is displayed.
Logged in as Diverta Hanako
Logged in as Diverta Jiro
Logged in as Diverta Taro
In the above sample code:
- Person A belongs to the
Executive
group and theIn-house Fishing Enthusiast Club
group. - Person B belongs to the
Regular Employee
group and theIn-house Fishing Enthusiast Club
group. - Person A creates a
Top Secret Document
.
As a result, Person B will be able to edit the Top Secret Document
.
Please make adjustments according to the project as follows: "Implement an operation where each member belongs to only one group" or "Add exception handling within the custom process."
Furthermore, by adding a trigger Before content validation, it is possible to implement a feature where only content created by members of the same group is displayed but cannot be edited.
Related documents
Support
If you have any other questions, please contact us or check out Our Slack Community.