Community
Vault Customization
Share your knowledge, ask questions, and explore popular Vault API, Data Standard, and VBA topics related to programming, creating add-ins, or working with the Vault API.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Vault APi c# restrictions to force stop action on failed login

1 REPLY 1
Reply
Message 1 of 2
raghulan
721 Views, 1 Reply

Vault APi c# restrictions to force stop action on failed login

What is the point in restrictions then, when the user can override it easily by clicking on the yes button in the restrictions dialogue box.

 

I have the simillar situation. Where I need to get user logins to authenticate before changing lifecycle.

how do i stop the user from changing lifecycle when the login fails.

 

VDF.Vault.Forms.Settings.LoginSettings login = new VDF.Vault.Forms.Settings.LoginSettings();
VDF.Vault.Currency.Connections.Connection connection = VDF.Vault.Forms.Library.Login(login);

           
            if (connection == null)
            {

                if (settings.RestrictedOperations.Contains(eventName))
                    eventArgs.AddRestriction(new ExtensionRestriction("Test", "Login Failed"));
                return;
            }

 But the user can click on Yes in the restrictions warning dialog box to bypass. How to stop the user from doing so.

 

Regards,

Raghulan Gowthaman Cert IV TAA, B.E,.
Senior Technical Consultant | Developer - R&D
A2K Technologies Sydney
Web : www.a2ktechnologies.com.au
www.civil3dforum.com | www.e4forums.com
www.zcodia.com.au
www.raghulangowthaman.com
1 REPLY 1
Message 2 of 2
smithmat
in reply to: raghulan

The user cannot override these restrictions.  I believe the dialog you are referring to is this one:

 

 

Restrictions Found

------------------------

Operation cannot continue because an extension raised restrictions.  Do you want to continue?

------------------------

[Yes] [No]

 

Choosing [Yes] does *not* cause the restriction to be bypassed and the action to be performed anyways.  Let me explain.

 

A given command might require several calls to the Vault server API to complete its work.  If one of these fails (due to a restriction), this dialog box is asking if the user would like to continue with the rest of the work of the command (assuming there is something that can be done even though one of these calls failed).  Consider a command that works on several files:  if it fails on one (and the user gets the restriction dialog) the dialog is essentially asking if the user wants to continue with attempting the work on the remaining files.

 

I've found at least one case where I believe this dialog shows up when it shouldn't.  I.e. a case where clicking Yes or No has the exact same effect since there is no more work being attempted.

 

So, in your case, regardless of what the user clicks, the restriction should still block the action.

 

Hope that helps,

- Matt

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report