SET QUOTED_IDENTIFIER ON

GO

-- =============================================================================
-- Manual post-deployment: register MMS procedures added after the initial
-- release so the API permission check can resolve them. mesf-core looks the
-- action up in SYSTEM.catActions / SEC.catProfilesActions; an unregistered
-- procedure fails with "Action ... Not Found In Database. Can Not Check Permission".
-- Idempotent: SEC.UpsertProcedureAndSetToProfile only inserts when missing.
-- =============================================================================
EXEC [SEC].[UpsertProcedureAndSetToProfile] '[MMS].[GetWorkOrdersBySourceEntry]', 'admin Profile', 'devops'
EXEC [SEC].[UpsertProcedureAndSetToProfile] '[MMS].[GetWorkOrdersBySourceEntry]', 'Supervisor Profile', 'devops'
EXEC [SEC].[UpsertProcedureAndSetToProfile] '[MMS].[GetWorkOrderCountsByEntries]', 'admin Profile', 'devops'
EXEC [SEC].[UpsertProcedureAndSetToProfile] '[MMS].[GetWorkOrderCountsByEntries]', 'Supervisor Profile', 'devops'
EXEC [SEC].[UpsertProcedureAndSetToProfile] '[MMS].[GetWorkOrderSourceEntry]', 'admin Profile', 'devops'
EXEC [SEC].[UpsertProcedureAndSetToProfile] '[MMS].[GetWorkOrderSourceEntry]', 'Supervisor Profile', 'devops'

GO

