Difference between revisions of "Elements access privilege"

From Larnitech wiki page
Jump to navigation Jump to search
Line 1: Line 1:
 +
<languages/>
 +
<translate>
 
Permissions can be created for all users groups, nesting is supported either,
 
Permissions can be created for all users groups, nesting is supported either,
 
for example, "item" which is not editable or which is not visible for some users can be created in "area".
 
for example, "item" which is not editable or which is not visible for some users can be created in "area".
Line 69: Line 71:
 
</syntaxhighlight>
 
</syntaxhighlight>
 
After setting the password, when you click on the "LAMP31112" item, the keyboard for entering the password appears to turn on/off the lamp.
 
After setting the password, when you click on the "LAMP31112" item, the keyboard for entering the password appears to turn on/off the lamp.
 +
</translate>

Revision as of 12:47, 26 January 2022

Other languages:
English • ‎русский

Permissions can be created for all users groups, nesting is supported either, for example, "item" which is not editable or which is not visible for some users can be created in "area".

The following construction is used for creating the users groups

1<user-groups groups="GROUP_NAME"/>

For adding users to the users group the following construction is used

1<users>
2        <USER1 groups="GROUP_NAME" name="USER1" password="1111"/>
3        <USER2 groups="GROUP_NAME" name="USER2" password="2222" permissions="7"/>
4        <USER2 password="2222" single-action="true"/>
5</users>

Within the tag all the users, their groups are entered, name and password attributes are specified for each concrete user. single-action="true" – the rules are applied only for one action (e.g. script activating)

User attribute "permissions" is responsible for accessing the "Advanced" tab in settings, Edit mode and "Setup" room

Bit number Description
0 Access to "Edit Mode"
1 Access to "Advanced" tab
2 Access to "Setup" room

Permissions parameter is used for restricting the access to the concrete element, for example

1<area name="AREA_NAME" permissions="*:ve-;USER1:ve+">
2    <item addr="311:12" name="LAMP31112" type="lamp" permissions="*:e+;USER1:e-"/>
3</area>

In this part of code is specified that AREA_NAME area is visible and editable for USER1,

for all other users (in our case only USER2) it is invisible.

"item" of lamp type with LAMP31112 name which is located in "area" with AREA_NAME name has its own authorisation for a concrete user,

it is specified in the code that "item" of lamp type with LAMP31112 name is visible for USER1 but USER1 cannot edit this "item".

All other users (in our case only for user USER2) can both see and edit this item.

Permissions parameters and their description

  • "ve+" – is visible and can be edited
  • "ve-" – is invisible and can’t be edited
  • "v+" – is visible
  • "v-" – is invisible
  • "e+" – can be edited
  • "e-" – can’t be edited

edit-mode-users="User1;User2" is to be added to "smarthouse" tag for setting mode password (interface 3).

Also you can use the password for the items to protect them from accidental clicking

Example:

1<item addr="311:12" name="LAMP31112" type="lamp" password="1234"/>

After setting the password, when you click on the "LAMP31112" item, the keyboard for entering the password appears to turn on/off the lamp.