Páginas filhas
  • Configure Privilege to control access to routines

How to configure the Privileges routine to control access permissions

Product:

Microsiga Protheus

Versions:

11 and 12

Step by step:

The Protheus Privilege routine lets you define routine access rules for users and groups, making it easier to manage and maintain rights.

There are two options to configure the Privileges routine:

1. Manual inclusion of routines: create a new privilege and include only the routines you want to configure.
- Access Configurator > User > Passwords > Privileges.

- Click Include.

- Enter a name (Rule field) and a description (Comment field) for the Privilege.

- Click twice under the Transaction/Routine column, and enter the name of the object of the routine you want to configure (MATA010, for example).

- To include other routines, press down on the keyboard.

Information:

For most routines, you can view the object name by pressing SHIFT + F6 on the routine screen. Some routines, such as the Spool on the Miscellaneous menu (which has the OURSPOOL object name), may not display the actual name of the object when you press SHIFT + F6. In these cases, we recommend contacting the support team responsible for the module to verify the name used.

Note:

From the lib labeled 20170208 on, you will be able to control the access of user functions. To do this, in the registration enter the "U_" without the "()", as in the example: U_CUSTFUNC.

User functions requesting controlled functionalities must be compiled into a source of the same name and with the static MenuDef() function - which is responsible for defining the functionalities menu - already implemented.


Example of Source: custfunc.prw

User Function CustFunc

Private aRotina := MenuDef()

//... rest of the code.

Return


Static Function Menudef

Local aRotina := { {"Pesquisar" ,"AxPesqui",0,1} ,;
{"Visualizar" ,"AxVisual",0,2} ,;
{"Incluir" ,"AxInclui",0,3} ,;
{"Alterar" ,"AxAltera",0,4} ,;
{"Excluir" ,"AxDeleta",0,5}}

Return aRotina

2. Inclusion of all routines of a menu: create a new privilege based on a menu. All the routines in this menu will be loaded for configuration.

- Access Configurator > User > Passwords > Privileges.

- Click Include.

- Click Other Actions (Related Actions) and select Menu.




- Click Next, then click the Magnifying Glass, and locate the .xnu file on the menu where you want to set up the privileges.



- Click Finish. The menu routines will be loaded.


- After you include the routines in the Rules per transaction/routine section, click on each routine to display the menu items in the transaction/routines functionalities section.

- In the Access column, next to each routine in the Rules per transaction/routine section, you can define access to the routine as: Denied, Allowed or Not Allowed.
- In the Access column, next to each menu item in the transaction/routine functionalities section, you can define access to the menu item as: Denied, Allowed or Not Allowed.



Tip:

The concept for the options Allowed/Not Allowed/Denied is used when using more than one privilege for a user or group. So, in the privileges list, if the same routine is detected, and in one of the privileges it is Denied, it overrides any other privilege in this routine that is either Allowed or Not Allowed. If a routine has a privilege set as Not Allowed, the routine is checked in other privileges of this user; if none other is Allowed, it becomes Not Allowed, but if the routine is Allowed in a privilege, it stays as Allowed. Then, the priority order of this setting is: Denied > Allowed > Not Allowed.


- After completing the Privilege routines settings, click Confirm.

Associating Privileges with a user or group of users.

once the privilege has been configured, you must associate it with a User or User Group for it to take effect.

- Access Configurator > User > Passwords > Users (or Groups).

- Click on the user (or group) and then Other Actions (Related Actions).

- Click Privileges.




- Double click under the Rule column and click on the Magnifying Glass

- Select the privilege you want to associate with this user/group and click OK.

- If you want this privilege to take effect only in a certain Company/Branch, enter the code in the Company Group/System Branch columns. If you want this privilege to work for all companies/branches the user can access, leave these fields blank.



- Click Confirm. The Privilege Rule is set.


Further information about user setting: Set users
Further information about group setting: Create a user group

Notes: