We are currently on 10.1.600 in Production but are preparing to go live on Kinetic 2023.1. In 10.1.600, I never figured out how MES menu security worked beyond the check boxes on the Employee record.
I have now figured out that Epicor added the MESMenu and MESMenuSecurity tables in the Erp schema. I also now understand that the MES Security is actually applied at two levels: Using the User Menu security for the user that logs into MES as well as the MES Menu Security applied through the Employee Role checkboxes using the permissions applied in the HandHeld/MES Security Maintenance. The MES Menu Security determines what buttons the Clocked In Employee can click on (which ones are enabled), beyond that, the user that logged into MES needs to have access to the MenuID that is associated with the MES Menu Item.
I wrote the SQL query below to display the resultant security from both Ice.Security as well as Erp.MESMenuSecurity:
SELECT DISTINCT S.[SecCode]
,M.MenuID
,M.MenuDesc
,IIF(S.[SecurityMgr] = 1, 'TRUE', 'FALSE') AS [SecurityMgr]
,IIF(S.[EntryList] = '*', 'TRUE', 'FALSE') AS [AllowAll]
,REPLACE(S.[EntryList], ',', '~') AS [AllowAccess]
,COALESCE(MESProdSec.ProdWorker, '') AS ProdWorker
,COALESCE(MESMHSec.MHWorker, '') AS MtlHandler
,COALESCE(MESSvcSec.SvcWorker, '') AS SvcWorker
,COALESCE(MESShipSec.ShipWorker, '') AS ShipRecv
,COALESCE(MESSupvSec.SupvWorker, '') AS Supervisor
,'FALSE' AS [DisAllowAll]
,'TRUE' AS [AllCompanies]
FROM [Ice].[Security] AS S
LEFT JOIN Ice.Menu AS M ON S.Company = M.Company AND M.SecCode = S.SecCode
INNER JOIN Erp.MESMenu AS MESMenu ON MESMenu.MenuID = M.MenuID AND MESMenu.MenuType = 'M'
LEFT JOIN (SELECT MM.MenuID, 'X' AS ProdWorker FROM Erp.MESMenuSecurity INNER JOIN Erp.MESMenu AS MM ON MM.MESMenuID = MESMenuSecurity.MESMenuID
WHERE MESMenuSecurity.Role = 'PRODUCTION' AND MESMenuSecurity.Company = 'AGR') AS MESProdSec ON MESProdSec.MenuID = M.MenuID
LEFT JOIN (SELECT MM.MenuID, 'X' AS MHWorker FROM Erp.MESMenuSecurity INNER JOIN Erp.MESMenu AS MM ON MM.MESMenuID = MESMenuSecurity.MESMenuID
WHERE MESMenuSecurity.Role = 'MATERIAL_HANDLER' AND MESMenuSecurity.Company = 'AGR') AS MESMHSec ON MESMHSec.MenuID = M.MenuID
LEFT JOIN (SELECT MM.MenuID, 'X' AS SvcWorker FROM Erp.MESMenuSecurity INNER JOIN Erp.MESMenu AS MM ON MM.MESMenuID = MESMenuSecurity.MESMenuID
WHERE MESMenuSecurity.Role = 'SERVICE' AND MESMenuSecurity.Company = 'AGR') AS MESSvcSec ON MESSvcSec.MenuID = M.MenuID
LEFT JOIN (SELECT MM.MenuID, 'X' AS ShipWorker FROM Erp.MESMenuSecurity INNER JOIN Erp.MESMenu AS MM ON MM.MESMenuID = MESMenuSecurity.MESMenuID
WHERE MESMenuSecurity.Role = 'SHIPPING_RECEIVING' AND MESMenuSecurity.Company = 'AGR') AS MESShipSec ON MESShipSec.MenuID = M.MenuID
LEFT JOIN (SELECT MM.MenuID, 'X' AS SupvWorker FROM Erp.MESMenuSecurity INNER JOIN Erp.MESMenu AS MM ON MM.MESMenuID = MESMenuSecurity.MESMenuID
WHERE MESMenuSecurity.Role = 'SUPERVISOR' AND MESMenuSecurity.Company = ',YourCompany') AS MESSupvSec ON MESSupvSec.MenuID = M.MenuID
ORDER BY M.MenuID