# Enabled property and Security?

**URL:** <https://forum.inductiveautomation.com/t/enabled-property-and-security/4159>\
**Category:** Ignition\
**Created:** [March 16, 2012, 9:31pm UTC](https://forum.inductiveautomation.com/t/enabled-property-and-security/4159 "2012-03-16T21:31:50Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![scott\_rister](https://avatars.discourse-cdn.com/v4/letter/s/5daacb/32.png) [@scott\_rister](https://forum.inductiveautomation.com/u/scott_rister)\
**Post date:** [March 16, 2012, 9:31pm UTC](https://forum.inductiveautomation.com/t/enabled-property-and-security/4159/1 "2012-03-16T21:31:50Z")

</div>

If you have Security on an object (button) configured to only allow a specific role, and also use the Enabled property linked to for example a tag, such that the button would be enabled only if an enabled tag were high. Does the Enabled property override the Security setting?  
if i want to enable/disable the object based on both the tag value and the user role do i need to script that into the enabled propery?

Thanks,  
Scott

---

<div class="post-metadata">

**Author:** ![Travis.Cox](https://avatars.discourse-cdn.com/v4/letter/t/b9bd4f/32.png) [@Travis.Cox](https://forum.inductiveautomation.com/u/Travis.Cox)\
**Post date:** [March 19, 2012, 11:09pm UTC](https://forum.inductiveautomation.com/t/enabled-property-and-security/4159/2 "2012-03-19T23:09:33Z")

</div>

Yes, the enabled property does override the security on the component. You can bind the enabled property to an expression that can do both:`{Path/To/Tag} = 1 && lookup({[System]Client/User/RolesDataSet}, "Special Role", "", 0, 0) != ""`Just replace “Special Role” with whatever role you are looking for. If you have more than one use && or ||.

---

<div class="post-metadata">

**Author:** ![Greg.Buehler](https://avatars.discourse-cdn.com/v4/letter/g/ecc23a/32.png) [@Greg.Buehler](https://forum.inductiveautomation.com/u/Greg.Buehler)\
**Post date:** [March 19, 2012, 11:27pm UTC](https://forum.inductiveautomation.com/t/enabled-property-and-security/4159/3 "2012-03-19T23:27:08Z")

</div>

You know, this is seems like it deserves some feature request attention. Can we maybe get an additional property or setting that will allow security to override the enable state?

---

<div class="post-metadata">

**Author:** ![Travis.Cox](https://avatars.discourse-cdn.com/v4/letter/t/b9bd4f/32.png) [@Travis.Cox](https://forum.inductiveautomation.com/u/Travis.Cox)\
**Post date:** [March 19, 2012, 11:50pm UTC](https://forum.inductiveautomation.com/t/enabled-property-and-security/4159/4 "2012-03-19T23:50:51Z")

</div>

That seems like a valid request. We should also have a special expression function to see if a user has a role.

---

<div class="post-metadata">

**Author:** ![Carl.Gould](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/carl.gould/32/7262_2.png) [@Carl.Gould](https://forum.inductiveautomation.com/u/Carl.Gould)\
**Post date:** [May 9, 2012, 8:26pm UTC](https://forum.inductiveautomation.com/t/enabled-property-and-security/4159/5 "2012-05-09T20:26:00Z")

</div>

The issue with security and enabled property conflicts has been solved with re-vamped component security in the upcoming 7.5 release.

---

<div class="post-metadata">

**Author:** ![Greg.Buehler](https://avatars.discourse-cdn.com/v4/letter/g/ecc23a/32.png) [@Greg.Buehler](https://forum.inductiveautomation.com/u/Greg.Buehler)\
**Post date:** [May 9, 2012, 8:38pm UTC](https://forum.inductiveautomation.com/t/enabled-property-and-security/4159/6 "2012-05-09T20:38:49Z")

</div>



---

<div class="post-metadata">

**Author:** ![Ivan](https://avatars.discourse-cdn.com/v4/letter/i/df788c/32.png) [@Ivan](https://forum.inductiveautomation.com/u/Ivan)\
**Post date:** [March 20, 2014, 3:21pm UTC](https://forum.inductiveautomation.com/t/enabled-property-and-security/4159/7 "2014-03-20T15:21:38Z")

</div>

What about this special expression function to see if a user has a role?

---

<div class="post-metadata">

**Author:** ![Carl.Gould](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/carl.gould/32/7262_2.png) [@Carl.Gould](https://forum.inductiveautomation.com/u/Carl.Gould)\
**Post date:** [March 20, 2014, 3:46pm UTC](https://forum.inductiveautomation.com/t/enabled-property-and-security/4159/8 "2014-03-20T15:46:00Z")

</div>

There is a “hasRole” expression that has been added into Ignition 7.7

---

<div class="post-metadata">

**Author:** ![diat150](https://avatars.discourse-cdn.com/v4/letter/d/a587f6/32.png) [@diat150](https://forum.inductiveautomation.com/u/diat150)\
**Post date:** [March 20, 2014, 4:12pm UTC](https://forum.inductiveautomation.com/t/enabled-property-and-security/4159/9 "2014-03-20T16:12:51Z")

</div>

You can maybe serve up your own function like this

put a custom string property on your root container like this

`
lookup({[System]Client/User/RolesDataSet},{Root Container.Numeric Label.rolerequired},"None", "Rolename")`

Then put a custom property on your root container that holds the role that you want to check for. This funtion would return the rolename if it was available, or would return “none” if the user doesnt have that role available. Assuming that the roles dataset that is available works like I think it does, this should work for you.

---

<div class="post-metadata">

**Author:** ![Ivan](https://avatars.discourse-cdn.com/v4/letter/i/df788c/32.png) [@Ivan](https://forum.inductiveautomation.com/u/Ivan)\
**Post date:** [March 21, 2014, 9:33am UTC](https://forum.inductiveautomation.com/t/enabled-property-and-security/4159/10 "2014-03-21T09:33:45Z")

</div>

> [@Carl.Gould](#):
>
> There is a "hasRole" expression that has been added into Ignition 7.7

Great! Thanks.

[quote="diat150"]You can maybe serve up your own function like this

put a custom string property on your root container like this

`
lookup({[System]Client/User/RolesDataSet},{Root Container.Numeric Label.rolerequired},"None", "Rolename")`

Then put a custom property on your root container that holds the role that you want to check for. This funtion would return the rolename if it was available, or would return "none" if the user doesnt have that role available. Assuming that the roles dataset that is available works like I think it does, this should work for you.[/quote]  
Thanks! This is a bit similar to what Travis suggested earlier, but I like the idea of using custom properties.
