# How do i make a button visible only to admins?

**URL:** <https://community.fliplet.com/t/how-do-i-make-a-button-visible-only-to-admins/136>\
**Category:** Get Help\
**Tags:** web-apps\
**Created:** [August 12, 2021, 7:17pm UTC](https://community.fliplet.com/t/how-do-i-make-a-button-visible-only-to-admins/136 "2021-08-12T19:17:01Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Virtua](https://avatars.discourse-cdn.com/v4/letter/v/43a26b/32.png) [@Virtua](https://community.fliplet.com/u/Virtua)\
**Post date:** [August 12, 2021, 7:17pm UTC](https://community.fliplet.com/t/how-do-i-make-a-button-visible-only-to-admins/136/1 "2021-08-12T19:17:01Z")

</div>

How do i make a button visible only to admins?

---

<div class="post-metadata">

**Author:** ![Mel](https://dub1.discourse-cdn.com/flex017/user_avatar/community.fliplet.com/mel/32/3_2.png) [@Mel](https://community.fliplet.com/u/Mel)\
**Post date:** [August 13, 2021, 10:54am UTC](https://community.fliplet.com/t/how-do-i-make-a-button-visible-only-to-admins/136/2 "2021-08-13T10:54:36Z")

</div>

Hello!

Fliplet has a screen template that enables a menu for viewing by admins only.

Check out the admin menu screen template.

Alternatively, you can use the developer options to apply code to a single button using the CSS and JavaScript tabs.

You will need to apply the following javascript:

```javascript

Fliplet.Session.get().then(function onSessionRetrieved(session) {
  var user;
  if (session.entries.dataSource) {
    user = _.get(session, 'entries.dataSource.data');
  }

  if (user['User Role'] === 'Admin') {
    $('.btn.btn-primary').show();
  }
});

```

The above code assumes you have a user data source with the column “User Role” and any admins are marked as “Admin” in this column

You will then need to hide the button for everyone else using this CSS:

```css

.btn.btn-primary{
display: none;
}

```
