Automatic State transition "Access denied" for non admin users


Why do I have feeling that this has worked before but now it throws an error? Some windows update maybe? Or something in my code?

Any help really welcome. This is making me  insane


' More code before but this is where it fails for non admin users

NextState = 101 'Lainassa
Dim NewState : Set NewState = CreateObject("MFilesAPI.PropertyValue")
NewState.PropertyDef = 39
NewState.Value.SetValue MFDataTypeLookup, NextState
Vault.ObjectPropertyOperations.SetProperty ObjVer, NewState

State transition from Valmis to Lainassa. Code activates that transition.

Activate state transition when code allows, but there no code behind that. Reason for this to hide manual transiotion.

And here is the error:

CoScriptObjectFactory.cpp, 465, Access denied. (0x800407E4)
ScriptErrorHelper.cpp, 96, Access denied. (0x800407E4)
MDispatchExImpl.h, 694, Access denied. (0x800407E4)
MDispatchExImpl.h, 994, Access denied. (0x800407E4)
MetadataCardAction.cpp, 386, Access denied. (0x800407E4)
MetadataCardAction.cpp, 570, Access denied. (0x800407E4)
MetadataEditor.cpp, 2967, Access denied. (0x800407E4)
MetadataModel.cpp, 4266, Access denied. (0x800407E4)
MetadataModel.cpp, 4703, Access denied. (0x800407E4)
ElectronicSignatureUIHelper.cpp, 235, Access denied. (0x800407E4)
MetadataModel.cpp, 12191, Access denied. (0x800407E4)
CoVaultMountingDocumentOperations.cpp, 3204, Access denied. (0x800407E4)
DocumentCache.cpp, 11283, Access denied. (0x800407E4)
DocumentCache.cpp, 11392, Access denied. (0x800407E4)
DocumentCache.cpp, 19559, Access denied. (0x800407E4)
RPCMethodCallWithRetry.h, 35, Access denied. (0x800407E4)
RPCMethodCallWithRetry.h, 35, Access denied. (0x800407E4)
RPCDocumentOperations.cpp, 12721, Access denied. (0x800407E4)
RPCDocumentOperations.cpp, 7386, Access denied. (0x800407E4)
MCallInLoop.h, 712, Access denied. (0x800407E4)
RPCDocumentOperationsHelper.cpp, 4170, Access denied. (0x800407E4)
RPCDocumentOperationsHelper.cpp, 3731, Access denied. (0x800407E4)
RPCDocumentOperationsHelper.cpp, 9381, Access denied. (0x800407E4)
RPCDocumentOperationsHelper.cpp, 9972, Access denied. (0x800407E4)
RPCDocumentOperationsHelper.cpp, 27544, Access denied. (0x800407E4)
RPCDocumentOperationsHelperPrivate.cpp, 2882, Access denied. (0x800407E4)
StateTransitionManager.cpp, 678, Access denied. (0x800407E4)
RPCDocumentOperationsHelper.cpp, 23872, Access denied. (0x800407E4)
RPCDocumentOperationsHelper.cpp, 23872, The state transition 'Valmis -> Lainassa' is not allowed. (0x800400C3)



Parents Reply
  • Typically the issue in these cases is that M-Files checks the state "before" (Valmis) and after (Lainassa), then checks that the user who modified the object has permission to make that transition.  With transitions made via code (e.g. setting property 39) it's often the case that you wish to stop a user making the transition but allow the code to, and that doesn't work.

    Often this is only seen when testing with non-administrative users, as administrators have the permission to move from any state to any other state.