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].[GetAssets]', 'admin Profile', 'devops'
EXEC [SEC].[UpsertProcedureAndSetToProfile] '[MMS].[GetAssets]', 'Supervisor Profile', 'devops'
EXEC [SEC].[UpsertProcedureAndSetToProfile] '[MMS].[GetAssemblies]', 'admin Profile', 'devops'
EXEC [SEC].[UpsertProcedureAndSetToProfile] '[MMS].[GetAssemblies]', 'Supervisor Profile', 'devops'
EXEC [SEC].[UpsertProcedureAndSetToProfile] '[MMS].[CreateAssembly]', 'admin Profile', 'devops'
EXEC [SEC].[UpsertProcedureAndSetToProfile] '[MMS].[CreateAssembly]', 'Supervisor Profile', 'devops'
EXEC [SEC].[UpsertProcedureAndSetToProfile] '[MMS].[UpdateAssembly]', 'admin Profile', 'devops'
EXEC [SEC].[UpsertProcedureAndSetToProfile] '[MMS].[UpdateAssembly]', 'Supervisor Profile', 'devops'
EXEC [SEC].[UpsertProcedureAndSetToProfile] '[MMS].[DeleteAssembly]', 'admin Profile', 'devops'
EXEC [SEC].[UpsertProcedureAndSetToProfile] '[MMS].[DeleteAssembly]', 'Supervisor Profile', 'devops'
EXEC [SEC].[UpsertProcedureAndSetToProfile] '[MMS].[GetAssetPartAssemblies]', 'admin Profile', 'devops'
EXEC [SEC].[UpsertProcedureAndSetToProfile] '[MMS].[GetAssetPartAssemblies]', 'Supervisor Profile', 'devops'
EXEC [SEC].[UpsertProcedureAndSetToProfile] '[MMS].[GetAssetDrawingAssemblies]', 'admin Profile', 'devops'
EXEC [SEC].[UpsertProcedureAndSetToProfile] '[MMS].[GetAssetDrawingAssemblies]', 'Supervisor Profile', 'devops'

GO

