Restict admin user permissions to only editing users he/she has created.
I believe what you're looking for is 'isInGroup'

{% if currentUser.isInGroup('groupHandle') %}


It will also accept an actual group object or a group ID as well.

There is also getGroups:

{{ entry.author.getGroups() }}


So you have several options:


If all users only have one group (so they can not be in two) you can check if the current user is in the same group like the first group of entry.author. But this has the disadvantage if someone wants to change his/her group the entry will become invisible for the previous group
You could attach the group handle to an entry. So you field create a plainTextField and insert the group handle of the author to this entry -> if the author changes his/her group the entry will still be available for the author as well as everyone who was able to see the entry before.


If you choose the second option you would be able to include the search condition in a ElementCriteriaModel very smooth. And search only entry that is connected by the current group of the currentUser. If someone should be able to see entries but he/she is not allowed to edit them you would just include the isInGroup condition to check if she/he may proceed.

For example your user list could look like that

{% set users = craft.users.find() %}
{% for user in users %}
    &lt;!-- everyone can see the firstName of each user --&gt;
    {{ user.firstName }} 
    {% if currentUser %}
        &lt;!-- but only logged in users can see the last name --&gt;
        {{ user.lastName }}
        {% set groupsOfUser = user.getGroups() %}
        {% if groupsOfUser|length %}
            {% if currentUser.isInGroup(groupsOfUser[0]) %}
                &lt;!-- only users of the same group can edit/delete or whatever --&gt;
            {% endif %}
        {% endif %}
    {% endif %}
{% endfor %}