Rights of Access

Rights of Access

 

image-20260506-213920.png

Access Rights for “Replenishment” Pages

This documentation describes the mechanism for configuring and managing access rights for the menu pages “Replenishment”:

  • Order

  • SKU Parameters

  • Diagrams

  • Calendar

The mechanism allows restricting user access to stores, suppliers, and actions at the level of access groups.

 

Access Rights Configuration (Client / Administrator)

1. General Principle

Access rights are managed through access groups.

  • A user can access only the Store – Supplier pairs defined in their groups.

  • A user can belong to multiple groups, but there must be no overlap in stores/suppliers.

2. ADMIN Role

A user with the ADMIN role:

  • Has full access to all actions, stores, and suppliers.

  • Is not affected by access groups.

For all other users:

  • If the user does not belong to any group, access is restricted to all suppliers and stores.

  • If the user belongs to groups, access is limited according to the group settings.

3. When Access Rights Changes Take Effect

  • Changes within an access group (editing suppliers/stores/actions) → apply immediately to all users in the group after page refresh.

  • Adding or removing a user from a group → the user must log out and log in again.

4. “Access Rights” Form

Menu path:
Menu → More → Access Rights (only users with the ADMIN role have access)

4.1 Creating and Configuring an Access Group

  • Click “Add” to create a group.

image-20260506-214031.png
  • A modal window opens to set the group name and access to all stores/suppliers.

image-20260506-214104.png
  • After clicking “Save”, the newly created group appears in the main table.

image-20260506-214308.png

Main table settings:

  1. User list – users belonging to the access group.

  2. Store list – stores the group users can access.

  3. Supplier list – suppliers the group users can access.

  4. All replenishment actions – grants access to all replenishment menu actions, which normally only ADMIN users can access. This includes order recalculation, mass order confirmation cancellations, and delivery adjustments.

  5. Without confirmation cancellation – prevents users from cancelling order confirmations in the “Order” form.

  6. Delete / Edit – delete the access group or edit its settings.

image-20260506-214339.png

The form also allows filtering access groups by users, stores, and suppliers, and searching by group name.

4.2 User Membership in Multiple Access Groups

  • A user may belong to multiple access groups.

  • If adding a user to a group would cause overlaps in Store – Supplier pairs with other groups the user already belongs to, the system will not allow it.

Также в форме есть возможность фильтровать группы доступа по пользователям, магазинам и поставщикам, а также осуществлять поиск по названию группы.

4.2. Присутствие пользователя в нескольких группах доступа

Пользователь может находиться в нескольких группах доступа. Но если будет попытка добавить пользователя в группу доступа, которая будет иметь пересечения по парам “Магазин – Поставщик” с другими группами доступа, в которых уже присутствует пользователь, система не позволит это сделать.

Access Restrictions for “Replenishment” Forms

General Filtering Principle

On all pages:

  • Filters show only stores and suppliers the user has access to.

  • If the user enters an ID manually for inaccessible objects, no data is returned.

1. Order

Access and Filtering:

  • Store filters → only accessible stores.

  • Supplier filters → only accessible suppliers + warehouses.

  • Tables → only accessible headers and rows.

Export / Import:

  • Export Excel (old) → only accessible orders.

  • Uploading user orders / delivery adjustments → attempts to modify inaccessible orders are ignored.

Additional Actions (if “All replenishment actions” is checked):

  • Order recalculation

  • Mass cancellation of confirmations

  • Delivery adjustment via order row inputs

If the user has no access to recalculate certain orders, a corresponding message is displayed.

Side Effects of Actions:

  • Tender orders: may select contracts with inaccessible suppliers; after saving, the user loses access to the order.

  • RC confirmation: confirms orders for stores.

  • Diagram recalculation: may modify all related orders.

  • Order possibility check: recipients → only accessible stores; suppliers → all.

  • “Stock (corrected)” / “Order (corrected)” / “Order optimization” changes: may cascade to other rows (RC ↔ stores).

2. SKU Parameters

  • Store and supplier filtering → according to access rights.

  • Contract modification → only for accessible suppliers in a specific store.

  • CSV import → all positions are checked; attempts to modify inaccessible positions result in an error.

3. Diagrams

  • Only diagrams with accessible stores/suppliers are available.

  • When creating:

    • Suppliers → only accessible

    • Recipients → only accessible stores

  • Adding stores → only accessible for the supplier; if a store cannot be added due to lack of access, a message is shown.

  • CSV import → access rights are checked for each diagram.

  • Additional actions (if “All replenishment actions” checked) → recalculation of orders for one or multiple diagrams; if access is missing, a message appears.

⚠️ If the user does not have access to the composition (RC), they:

  • Will not see the composition diagram.

  • Will see recipient diagrams.

4. Calendar

  • Store and supplier filtering → according to access rights.

  • Inaccessible events are not displayed.

  • When creating an event → only the user’s stores and suppliers are available.

Client Configuration Files

1. .ini File

Order of ini-file inclusion (mandatory):

@include ../mssql_rpm_subqueries.ini @include ../mssql_rpm_subqueries_access_rights.ini @include ../mssql_rpm.ini

For other DBMS, use corresponding files.

Options File

Enable replenishment access rights:

replenishment: { userPermissions: true // enables access rights usage }
  • If false or missing → all access rights logic is ignored.

Modifying selectUserSql in security

Adds the list of access groups to the user at login. Example for MSSQL:

security: { selectUserSql: "select m.ID, m.NAME, m.USERNAME, m.ADMIN, m.PWD, m.SALT, m.ACCESS_BY_PAGE, \ string_agg(au.ACCESS_RIGHT_ID, ',') as ACCESS_GROUPS \ from MANAGER m \ left join ACCESS_USERS au on au.USER_ID = m.ID \ where m.NAME = [username] \ group by m.ID, m.NAME, m.USERNAME, m.ADMIN, m.PWD, m.SALT, m.ACCESS_BY_PAGE", }
  • If this query is not modified and access rights are enabled in options, the system will not see the user’s access groups, and nothing will be displayed unless the user is ADMIN.