# Workaround to permission a “switch” component?

**URL:** https://community.glideapps.com/t/workaround-to-permission-a-switch-component/5767
**Category:** Ask for Help
**Created:** [March 24, 2020, 1:02pm UTC](https://community.glideapps.com/t/workaround-to-permission-a-switch-component/5767 "2020-03-24T13:02:41Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![Rasha](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/rasha/32/4585_2.png) [@Rasha](https://community.glideapps.com/u/Rasha)
#### Post date: [March 24, 2020, 1:02pm UTC](https://community.glideapps.com/t/workaround-to-permission-a-switch-component/5767/1 "2020-03-24T13:02:41Z")

</div>

Building an app for a group who, under normal circumstances, derives 80% of its revenue from wholesale sales to restos and now-collapsing foreign export markets. A barebones infrastructure for DTC distro, the app will be a template for their individual operations.

Want to give producers (not customers who use the app) the ability to toggle “ **In stock** ” / “ **Out of Stock** ” via a **Switch** component not a manual update in the sheet, while they’re out in the field. With permissions, is there a workaround other than creating TWO apps for the same sheet? Need to keep UX super simple and avoid the chance of major errors.

Appreciate any tips!

---

<div class="post-metadata">

### Author: ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)
#### Post date: [March 24, 2020, 1:12pm UTC](https://community.glideapps.com/t/workaround-to-permission-a-switch-component/5767/2 "2020-03-24T13:12:01Z")

</div>

Read this. Basically you will need to create a relation from your items to an admin sheet using a Relation and Lookup to get a list of emails that have access to the switch. Then set visibility to only show when the signed in user is in the lookup.

> [@Admin apps + editing rights](https://community.glideapps.com/t/admin-apps-editing-rights/4465/2):
>
> This is a write-up on some additional thoughts to go along with the video. In regards to the single app example, one idea I had is to build a dynamic list of admin emails. Instead of adding a static column in the sheet with an admin email address, I have two ideas for a dynamic value instead. This first idea is to have an admin sheet that lists all of the admin email addresses. You could create a Single Value column on the data sheet which will obtain the email address of a single admin email…

---

<div class="post-metadata">

### Author: ![Rasha](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/rasha/32/4585_2.png) [@Rasha](https://community.glideapps.com/u/Rasha)
#### Post date: [March 24, 2020, 1:56pm UTC](https://community.glideapps.com/t/workaround-to-permission-a-switch-component/5767/3 "2020-03-24T13:56:27Z")

</div>

Thanks @Jeff_Hager. This would work if I were to remain in control of the app but I’m allowing others (some of whom not at all tech-savvy) to copy and use on their own. Thus, the need to simplicity.

---

<div class="post-metadata">

### Author: ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)
#### Post date: [March 24, 2020, 2:03pm UTC](https://community.glideapps.com/t/workaround-to-permission-a-switch-component/5767/4 "2020-03-24T14:03:20Z")

</div>

It’s actually super simple and the structure would remain the same if the app was copied. Only different user emails would be entered. The use of an admin or permission sheet would be needed no matter what. How would you plan to define user roles?

---

<div class="post-metadata">

### Author: ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)
#### Post date: [March 24, 2020, 2:08pm UTC](https://community.glideapps.com/t/workaround-to-permission-a-switch-component/5767/5 "2020-03-24T14:08:24Z")

</div>

I’m sure I have several posts like this, but here is a basic step by step.

> [@Allow only signed in users to posts](https://community.glideapps.com/t/allow-only-signed-in-users-to-posts/5286/4):
>
> Add a template column to the Blank Tab sheet with a value that says ‘Profile’ Add an identical template column to the Profile sheet with the same value of ‘Profile’ Create a relation column in the Blank Tab sheet that links the Profile columns together in both sheets Create a lookup column in the Blank Tab sheet that gets the email address from the relation. Set visibility on the button to show when when the lookup column is signed in user.

---

<div class="post-metadata">

### Author: ![Rasha](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/rasha/32/4585_2.png) [@Rasha](https://community.glideapps.com/u/Rasha)
#### Post date: [March 24, 2020, 2:36pm UTC](https://community.glideapps.com/t/workaround-to-permission-a-switch-component/5767/6 "2020-03-24T14:36:34Z")

</div>

Re: user roles, to answer your question:

I’m setting up the app for a 1-admin use case but there will be varying needs. I have permissions set to public for a couple of reasons. Primarily simplicity, but also:

- Want to make sure providers can preview all features from a share link without sign-in requirement.
- Reduced purchase friction for customers ready to place an order via form (no shopping cart).

The only feature that necessitates per-user data is favoriting an item.

Regarding the proposed solution - Admin still has to add their email for Admin Rights in a tab’s visibility settings, no?

Going through more write-ups.

---

<div class="post-metadata">

### Author: ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)
#### Post date: [March 24, 2020, 5:06pm UTC](https://community.glideapps.com/t/workaround-to-permission-a-switch-component/5767/7 "2020-03-24T17:06:27Z")

</div>

OK, you didn’t mention that the app would be public. Some sort of sign in is required for the app to know who the user is. How would you determine if a user is a provider or an admin and not a customer?

At this time, Glide disables per user filtering and visibility if you are not using ‘Public with Email’ or Whitelist.

Yes, with my solution, you would need a sheet with a list of emails.

---

<div class="post-metadata">

### Author: ![Rasha](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/rasha/32/4585_2.png) [@Rasha](https://community.glideapps.com/u/Rasha)
#### Post date: [March 24, 2020, 6:02pm UTC](https://community.glideapps.com/t/workaround-to-permission-a-switch-component/5767/8 "2020-03-24T18:02:41Z")

</div>

Thanks for your help @Jeff_Hager! More advanced permissions will be useful to providers who want to level up basic version of the app. As is, it’s not necessary to benefit from basic features.
