# Enable voting just for certain group of people

**URL:** <https://meta.discourse.org/t/enable-voting-just-for-certain-group-of-people/69483>\
**Category:** Support\
**Tags:** topic-voting\
**Created:** [6 Settembre 2017, 3:58pm UTC](https://meta.discourse.org/t/enable-voting-just-for-certain-group-of-people/69483 "2017-09-06T15:58:37Z")\
**Posts on this page:** 1\
**Showing post:** 11

<div class="post-metadata">

**Author:** ![Johani](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/johani/32/176920_2.png) [@Johani](https://meta.discourse.org/u/Johani)\
**Post date:** [26 Gennaio 2018, 5:50am UTC](https://meta.discourse.org/t/enable-voting-just-for-certain-group-of-people/69483/11 "2018-01-26T05:50:26Z")

</div>

#### Mind you… this is very easy to bypass for someone with a bit of knowledge.

That being said, if all the people you want to be able to vote are members of a group(s), you can “disable” or hide the vote button from everyone else with CSS.

Note the quote marks on the word disable, you’re not really disabling anything here, this is purely visual.

* * *

Discourse adds group classes to the body that match user groups

The class added follows this naming structure:

`.primary-group-GROUP_NAME`

So `.primary-group-` is a prefix added to the group name and spaces in the group name change to underscores.

you can use those as CSS selectors.

For example if the people you want to have the ability to vote all fall under the group name Awesome People

Then the selector would be `.primary-group-awesome_people`

Now that you know the selector, you need to invert it to hide / disable the button from everyone but those people in that group

* * *

So first you select `body`

Like so:

```plaintext
body {
	// styles
}

```

then qualify it with the group name like so

```plaintext
body:not(.primary-group-awesome_people) {
	// styles
}

```

The you add the vote button to the selector:

```plaintext
body:not(.primary-group-awesome_people) .vote-button {
	// styles
}

```

Then you finally add your styles, you have to options here, either remove the button with `display:none` or “disable” clicking it with `pointer-events: none;`

So the final result would be either:

```plaintext
body:not(.primary-group-awesome_people) .vote-button {
	display:none
}

```

Or

```plaintext
body:not(.primary-group-awesome_people) .vote-button {
	pointer-events: none;
	user-select: none;
}

```

You can also use more than one group like so:

```plaintext
body:not(.primary-group-awesome_people):not(.primary-group-car_owners):not(.primary-group-chefs)
	.vote-button {
	pointer-events: none;
	user-select: none;
}

```

And that would only “allow” members of the Awesome people, Car Owners, and chefs groups to be able to click / see the voting button.

* * *

#### Also, note that I have not tested this extensively but would be happy help if issues come up.

---

_[View the full topic](https://meta.discourse.org/t/enable-voting-just-for-certain-group-of-people/69483)._
