<p>As Fabio pointed out, i'd managed to miss the <a href="http://buildwithcraft.com/docs/templating/usermodel#isInGroup" rel="nofollow">isInGroup</a> method. Slightly embarrassing!</p>

<p>So for anyone else looking to do what i asked, i changed my code to the following:</p>

<pre><code>{% if entry.author.isInGroup('authors') %}
</code></pre>

<p>and it works perfectly now.</p>

CC BY-SA 3.0
2015-01-23T16:54:48.880Z
2015-01-23T19:02:50.597Z
2015-01-23T19:02:50.597Z
Dan Owen
<p>I'm trying to check if a user is part of a user group but not having any success!
I tried this:</p>

<pre><code>{% if entry.author.groups == 'authors' %}
</code></pre>

<p>But even though the user is definitely in a user group with that handle, the output inside that if statement doesn't show up.</p>

<p>I also tried this:</p>

<pre><code>{% if entry.author.admin != 1 %}
</code></pre>

<p>That DID work, but unfortunately i don't just want to check if the user is not an admin, i want to specifically check their user group.</p>

CC BY-SA 3.0
2015-01-23T16:46:50.363Z
maybe you can find your answer here?
[questions/1087](http://craftcms.stackexchange.com/questions/1087/check-user-is-in-user-group-custom-user-permissions)
Fabio Carriere
CC BY-SA 3.0
2015-01-23T16:51:36.110Z
Ah, spot on Fabio! I feel a bit foolish that i somehow missed the isInGroup method. My code now looks like this:
{% if entry.author.isInGroup('authors') %}
And works like a charm!
Dan Owen
<user-groups><author>
How can i check an entry author's user group?
# How can i check an entry author's user group?

(Asked by: username_0 on 2015-01-23)

I'm trying to check if a user is part of a user group but not having any success!
I tried this:
{% if entry.author.groups == 'authors' %}

But even though the user is definitely in a user group with that handle, the output inside that if statement doesn't show up.
I also tried this:
{% if entry.author.admin != 1 %}

That DID work, but unfortunately i don't just want to check if the user is not an admin, i want to specifically check their user group.

**Tags:** user-groups, author

> **Comments:**
> **username_1**: maybe you can find your answer here? [questions/1087](http://craftcms.stackexchange.com/questions/1087/check-user-is-in-user-group-custom-user-permissions)  
> **username_0**: Ah, spot on Fabio! I feel a bit foolish that i somehow missed the isInGroup method. My code now looks like this: {% if entry.author.isInGroup('authors') %} And works like a charm!  

---

## 1 answers

### Answer by username_0 on 2015-01-23. Score: 5

As Fabio pointed out, i'd managed to miss the isInGroup method. Slightly embarrassing!
So for anyone else looking to do what i asked, i changed my code to the following:
{% if entry.author.isInGroup('authors') %}

and it works perfectly now.


---

