Restrict Fields is a Statamic addon that allows you to restrict fields in the control panel to certain users, groups or roles.
Run the following command from your project root:
composer require thoughtco/statamic-restrict-fields
Once installed, 3 new custom condition methods become available to use:
Use with a value in the format:
restrictUsers:user_id_1,user_id_2
Use with a value in the format:
restrictGroups:group_slug_1,group_slug_2
Use with a value in the format:
restrictRoles:role_slug_1,role_slug_2
You may pass super
to the restrictGroups
and restrictRoles
condition methods in order to include superadmins.
Example: restrictGroups:super,group_slug_1,group_slug_2