All tables
tables · table

userrightsmain

The userrightsmain table is a core security and configuration table within the SQL Server database. It manages granular user permissions at the menu and form level. For every user defined in the system, this table specifies which application features (captions/menus) are visible and what specific CRUD (Create, Read, Update, Delete) actions they are authorized to perform.

Row count
534
Last entry
Source
tables

Columns

15
ColumnTypeNullableMeaning
indexintegerNoPrimary key, unique identifier for the record.
compcodestringNoCompany code identifying the specific business entity.
SnointegerYesSerial number or sequence identifier for the menu item.
user_codestringYesUnique login identifier for the user. Matches the application's login name.
captionstringYesThe display label shown to the user in the application menu.
menunamestringYesThe internal technical name of the menu control.
formnamestringYesThe name of the physical form or screen associated with the menu item.
menuenablestringYesBoolean flag indicating if the menu item is visible/active for the user.
additionstringYesRight to create/add new records within the specific form.
modificationstringYesRight to edit existing records within the specific form.
deletionstringYesRight to remove records within the specific form.
enquirystringYesRight to view or search for records (Read-Only access).
mainformstringYesThe parent or container form name that hosts this specific menu/object.
mtypestringYesCategorization of the entry type (Likely Transaction vs View).
OnForm_ObjectstringYesSpecific UI object name affected by the rights if not the whole form.

Full documentation

### 1. Overview
 The `userrightsmain` table is a core security and configuration table within the SQL Server database. It manages granular user permissions at the menu and form level. For every user defined in the system, this table specifies which application features (captions/menus) are visible and what specific CRUD (Create, Read, Update, Delete) actions they are authorized to perform.
 
 ### 2. Column Dictionary
 
 | Column | Type | Nullable | Meaning | Allowed Values | SQL Usage |
 | :--- | :--- | :--- | :--- | :--- | :--- |
 | **index** | integer | No | Primary key, unique identifier for the record. | | PK |
 | **compcode** | string | No | Company code identifying the specific business entity. | e.g., "DAS" | FK / Join Key |
 | **Sno** | integer | Yes | Serial number or sequence identifier for the menu item. | | Sort Key |
 | **user_code** | string | Yes | Unique login identifier for the user. Matches the application's login name. | e.g., "joge" | FK / Join Key |
 | **caption** | string | Yes | The display label shown to the user in the application menu. | "Purchase Order - Add", "Department" | UI Display |
 | **menuname** | string | Yes | The internal technical name of the menu control. | "mnupo1", "mnugrp" | Join Key |
 | **formname** | string | Yes | The name of the physical form or screen associated with the menu item. | "frmsupmas", "frmDepartment_M" | Join Key |
 | **menuenable** | string | Yes | Boolean flag indicating if the menu item is visible/active for the user. | "Y", "N" | Permission Logic |
 | **addition** | string | Yes | Right to create/add new records within the specific form. | "Y", "N" | Permission Logic |
 | **modification** | string | Yes | Right to edit existing records within the specific form. | "Y", "N" | Permission Logic |
 | **deletion** | string | Yes | Right to remove records within the specific form. | "Y", "N" | Permission Logic |
 | **enquiry** | string | Yes | Right to view or search for records (Read-Only access). | "Y", "N" | Permission Logic |
 | **mainform** | string | Yes | The parent or container form name that hosts this specific menu/object. | "frmcstore1", "frmprod" | Context Key |
 | **mtype** | string | Yes | Categorization of the entry type (Likely Transaction vs View). | "T", "V" | Filter |
 | **OnForm_Object** | string | Yes | Specific UI object name affected by the rights if not the whole form. | "frmwostatus" | Object Mapping |
 
 ### 3. Relationships & Join Map
 
 The table serves as the primary enforcement point for user access and can be joined to several configuration and audit tables based on `SCHEMA_MAP`.
 
 #### Joins (Authoritative)
 * **User Master:** Join `userrightsmain (user_code)` to `pass1 (username)` to retrieve user profiles and account statuses.
 * **Company Menus:** Join `userrightsmain (compcode, menuname)` to `CompanyConfigMenu (compcode, MenuName)` to synchronize application-wide visibility settings with user-specific rights.
 * **Form Monitoring:** Join `userrightsmain (compcode, formname)` to `Form_Active_Status (compcode, form_name)` to audit active forms against authorized permissions.
 * **Activity Logs:** Join `userrightsmain (user_code)` to `Deletion_Log (ERP_User)` to reconcile deletions against the `deletion` permission flag.
 * **Header Rights:** Join `userrightsmain (user_code)` to `UserrightsHdr (usercode)` for a summarized view of module-level permissions.