Show/Hide Security for Attributes

Show/Hide Security for attributes is useful when you have some attributes that can be visible just by some group of users (grouped in one or more roles). So, you will enable this kind of security for each attribute needed (you could do it for all the attributes also).

WorkWithPlus will automatically verify if some user has permission to visualize it, and in case it doesn't have permission the attribute will be hidden in all the WebForms where it appears (Transaction, Selections and ExtraSelections including ColumnsSelector, View, Prompt and in the WebPanels created using templates).

If you have a Panel which only contains attributes and variables, and all of those attributes and variables have Show/Hide security enabled, WorkWithPlus will automatically hide the panel when some user do not have permission to visualize any of the attributes or variables within that Panel. And it analogous with Tabs, if you have a Tab which only contains attributes and variables, and all of those attributes and variables have Show/Hide security enabled, WorkWithPlus will automatically hide the tab when some user do not have permission to visualize any of the attributes or variables within that tab.View an example of Tab and Panel

In order to enable Show/Hide Security to some attribute in particular, you have to set the property 'Enable Show/Hide' of the attribute's definition to True.

You can visualize below an example of the property for 'PersonLastName' attribute:

ShowHideSecurityForAttributesImg01

After you enable the Show/Hide Security, the property 'Show/Hide Security Functionality Key' appears. This property will set the name of the permission that the attribute will have for defining whether that attribute will be visible for some role (the default values for both properties are taken from WorkWithPlus Configuration -> Security ( Advanced Security or GAM ). So, if you want to enable Show/Hide Security to all the attributes of your application, you should change the property 'Default Enable Show/Hide Security' from WorkWithPlus Configuration -> Security (Advanced Security or GAM) to True.

In all the objects that the attribute with Show/Hide Security enabled appears within an instance (Transaction, Selection, View, WebPanel based on a template, etc.), there is a property named 'Show/Hide Security Functionality Key'. This property defines the name of the permission to visualize the attribute.

Here is an example of this property in an attribute node within Selection node:

ShowHideSecurityForAttributesImg02

The value '<default>' will took the name of the permission from the same property of the attribute's definition (image showed when we enable Show/Hide Security to PersonLastName)  

It is important to have in mind that every time that we change some 'Security Functionality Key' and we want to impact these changes in the application at runtime, we have to follow the steps of the section Update Security Functionalities of Advanced Security or GAM (depending on the Security that we have enabled):


Then, after following the steps above and making build all, you can visualize the changes at runtime (the security for attributes using Advanced Security or GAM is the same from developers point of view, the only difference is that they use different objects in order to configure the permissions of each role):

Example of Show/Hide Attribute in GAM Security + WorkWithPlus

Some user logs in to the application with the role: 'New Role', and this role do not have permission to visualize PersonLastName attribute. So, he won't visualize PersonLastName in any of the WebForms where this attribute appears (Transaction, Selection and ExtraSelection including ColumnsSelector, View, Prompt, and any WebPanel which contains this attribute).

He opens PersonWW (which is a ColumnsSelector grid) and verify that the attribute is not visible:

ShowHideSecurityForAttributesImg03

He goes to visualize some Person

ShowHideSecurityForAttributesImg04

Then he goes to edit that Person:

ShowHideSecurityForAttributesImg05

And finally he goes to some WebPanel based on a template:

ShowHideSecurityForAttributesImg06

In all cases, the attribute PesonLastName is never visible.

Now he logs out, and the administrator enters to edit the permissions of Visitor role in order to give permission to visualize that attribute:

ShowHideSecurityForAttributesImg07

Now the user with 'New Role' role logs in and will visualize that attribute in all the WebPanels:
He opens PersonWW (which is a ColumnsSelector grid) and verify that the attribute now is visible:

ShowHideSecurityForAttributesImg08

He goes to visualize some Person:

ShowHideSecurityForAttributesImg09

Then he goes to edit that Person:

ShowHideSecurityForAttributesImg10

And finally he goes to some WebPanel based on a template:

ShowHideSecurityForAttributesImg11

Example of Show/Hide Attribute in Advanced Security

Some user logs in to the application with the role: 'Visitor', and this role do not have permission to visualize PersonLastName attribute. So, he won't visualize PersonLastName in any of the WebForms where this attribute appears (Transaction, Selection and ExtraSelection including ColumnsSelector, View, Prompt, and any WebPanel which contains this attribute).

When he enters to create, edit or delete a Person it will visualize the following image:

ShowHideSecurityForAttributesImg12

He logs out, and the administrator enters to edit the permissions of Visitor role in order to give permission to visualize that attribute:

ShowHideSecurityForAttributesImg13

Now the user with Visitor role logs in and will visualize that attribute:

ShowHideSecurityForAttributesImg14