<p>Could you use the new Rules when you edit a field on a Section? When you edit the field using the little cog you get the pop out where you can edit the label or give it a description. What you can also do is show/hide the field based on various rules. One of those rules can be if the current editing user is part of a particular group. See picture below.</p>
<p><a href="https://i.sstatic.net/TMlCuIuJ.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/TMlCuIuJ.png" alt="enter image description here" /></a></p>
<p>Granted if you've got hundreds of fields on the section then this will be quite a tedious process, but if you've only a handful, it might do the trick. Obviously the ones that you are hiding would have to be not required.</p>

CC BY-SA 4.0
2024-08-06T15:00:00.027Z
I tried that, but I can't allow a user to be either administrator (the native admin) or from a user group, if I add both lines it doesn't work.
user16211
CC BY-SA 4.0
2024-08-07T07:03:44.153Z
Would you be able to add a bit more description to your question, to explain the problem you are trying to solve in a bit more detail? It's not clear from the question where being an administrator comes into it. Are you saying that you want Admins to also only see the single field? Wouldn't they see all the fields anyway?
Steve Holland
CC BY-SA 4.0
2024-08-07T12:44:12.670Z
I mean using the user conditions could work but still the restricted user could go to any of the entries in the section and even change the status, slug etc.
I want them to edit only one field of one entry in a section.
user16211
CC BY-SA 4.0
2024-08-21T15:22:16.870Z
user1 = admin, user2 = group1 ... add both to group1 + add group1 to the rule above ... user1 will keep having admin privileges and adding him to group1 won't affect anything.
Leo Leoncio
CC BY-SA 4.0
2024-08-06T09:24:22.690Z
2024-08-06T09:24:22.690Z
Steve Holland
<p>I want to restrict a user group to <strong>view and edit only one field of one entry</strong> in the CP.<br />
The field in question is a Matrix so I'm not sure I can extend a control panel page just for that, since I don't see a function to add a matrix field.<br />
<a href="https://craftcms.com/docs/4.x/extend/cp-templates.html#form-inputs" rel="nofollow noreferrer">https://craftcms.com/docs/4.x/extend/cp-templates.html#form-inputs</a></p>
<p>I tried messing with the event <code>Element::EVENT_AUTHORIZE_VIEW</code> but when I use <code>$event-&gt;authorized</code> it doesn't do anything.</p>
<p>Finally, I tried adding some User conditions on a tab for the Entry type but I can't seem to add multiple &quot;OR&quot; conditions (other tabs can be viewed for admin and regular groups, except the specific tab that contains my matrix field)</p>

<users><craft4>
Restrict a user group to view/edit only one field
# Restrict a user group to view/edit only one field

(Asked by: username_0 on 2024-08-05)

I want to restrict a user group to **view and edit only one field of one entry** in the CP.  
The field in question is a Matrix so I'm not sure I can extend a control panel page just for that, since I don't see a function to add a matrix field.  
<https://craftcms.com/docs/4.x/extend/cp-templates.html#form-inputs>

I tried messing with the event `Element::EVENT_AUTHORIZE_VIEW` but when I use `$event->authorized` it doesn't do anything.

Finally, I tried adding some User conditions on a tab for the Entry type but I can't seem to add multiple "OR" conditions (other tabs can be viewed for admin and regular groups, except the specific tab that contains my matrix field)

**Tags:** users, craft4


---

## 1 answers

### Answer by username_1 on 2024-08-06. Score: 1

Could you use the new Rules when you edit a field on a Section? When you edit the field using the little cog you get the pop out where you can edit the label or give it a description. What you can also do is show/hide the field based on various rules. One of those rules can be if the current editing user is part of a particular group. See picture below.

[![enter image description here](https://i.sstatic.net/TMlCuIuJ.png)](https://i.sstatic.net/TMlCuIuJ.png)

Granted if you've got hundreds of fields on the section then this will be quite a tedious process, but if you've only a handful, it might do the trick. Obviously the ones that you are hiding would have to be not required.

> **Comments:**
> **username_0**: I tried that, but I can't allow a user to be either administrator (the native admin) or from a user group, if I add both lines it doesn't work.  
> **username_1**: Would you be able to add a bit more description to your question, to explain the problem you are trying to solve in a bit more detail? It's not clear from the question where being an administrator comes into it. Are you saying that you want Admins to also only see the single field? Wouldn't they see all the fields anyway?  
> **username_0**: I mean using the user conditions could work but still the restricted user could go to any of the entries in the section and even change the status, slug etc. I want them to edit only one field of one entry in a section.  
> **username_2**: user1 = admin, user2 = group1 ... add both to group1 + add group1 to the rule above ... user1 will keep having admin privileges and adding him to group1 won't affect anything.  

---

