# \[DONE\] Hide Spaces from non-Admin Users

**URL:** <https://community.fibery.io/t/done-hide-spaces-from-non-admin-users/4004>\
**Category:** Ideas & Features\
**Tags:** permissions\
**Created:** [February 16, 2023, 8:42pm UTC](https://community.fibery.io/t/done-hide-spaces-from-non-admin-users/4004 "2023-02-16T20:42:19Z")\
**Posts on this page:** 1\
**Showing post:** 13

<div class="post-metadata">

**Author:** ![Chr1sG](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/chr1sg/32/3941_2.png) [@Chr1sG](https://community.fibery.io/u/Chr1sG)\
**Post date:** [February 20, 2023, 11:01am UTC](https://community.fibery.io/t/done-hide-spaces-from-non-admin-users/4004/13 "2023-02-20T11:01:37Z")

</div>

OK, here’s a little something that you might find useful. It’s a script that will propagate the space ordering that you have to any other user (including hiding spaces).

```auto

const fibery = context.getService('fibery');

for (const entity of args.currentEntities) {
    const userToCopy = await fibery.getEntityById(entity.type, args.currentUser['Id'], ['fibery/menu-rank']);
    await fibery.updateEntity(entity.type, entity.id, { 'fibery/menu-rank': userToCopy['fibery/menu-rank'] });
}

```

It should be put in a button automation in the User database (you need to open a User’s entity view and click the triple dots, choose Edit fields, to create an automation).  
Then you can open any User’s entity view and press the button. They will then inherit your space ordering.

So, for example, you (Admin) have the spaces arranged like this:

- C
- B
- D  
Hidden  
– A

A new user logs in, with access only to A, B and C. They might see this:

- A
- B
- C

but if you run this script on their User, they will get this:

- C
- B  
Hidden  
– A

Disclaimer: this is not official/publicly supported/guaranteed to work etc.

p.s. you will probably want to hide the button when you’re not using it 😉

---

_[View the full topic](https://community.fibery.io/t/done-hide-spaces-from-non-admin-users/4004)._
