Skip to main content

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].

Image from Gyazo

Click [Add].

Image from Gyazo

Set up the custom function as follows:

FieldValue
Titlefiter_members_of_the_same_group
Identifierfiter_members_of_the_same_group
TriggerVisibility of content in Admin panel / Specify the target content definition ID
ProcessingThe following content
fiter_members_of_the_same_group
loading...

Image from Gyazo

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:

MemberGroup
Diverta HanakoTester
Diverta JiroEditor
Diverta TaroEditor

Image from Gyazo

Next, log in with each member and create one content each.

Image from Gyazo

info

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

Image from Gyazo

Logged in as Diverta Jiro

Image from Gyazo

Logged in as Diverta Taro

Image from Gyazo

caution

In the above sample code:

  • Person A belongs to the Executive group and the In-house Fishing Enthusiast Club group.
  • Person B belongs to the Regular Employee group and the In-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."

tip

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.


Support

If you have any other questions, please contact us or check out Our Slack Community.