Modify user permission/security with API

Modify user permission/security with API

Anonymous
Not applicable
1,918 Views
11 Replies
Message 1 of 12

Modify user permission/security with API

Anonymous
Not applicable

Hi!

 

I use Vault Pro 2018.

 

We use a lifecycle in the company, with different states. Each state has some permissions (allow/deny/empy for Read/modify/Delete) for groups and/or users (see picture)

 

Is it possible to modify these permissions thanks to the API?

Same question for the transitions, is it possible to modify the permissions that allow a user/group to use a transition thanks to the API?

 

Some of my users make frequently mistakes, and I need to give them permissions on "non-authorized" states so that they correct their mistake by themselves. Adding the permissions and then removing the permissions through all windows and menus takes a lot of time, so I would like to make a small software to modify quickly these permissions.

 

Thank you in advance 🙂

 

 

Another question that may be linked to the previous one:

Is it possible to read and modify the list of "Custom Job Types" that are in the transitions? (see picture2)

0 Likes
Accepted solutions (2)
1,919 Views
11 Replies
Replies (11)
Message 2 of 12

Anonymous
Not applicable

I have another need which may be linked to the previous one.

Since some custom jobs disppears (Atuodesk is working on it), I would like (at least) to read which custom jobs are set in all my transitions, in order to have an alert if one job disappeared. I could launch this verification every hour for example...

0 Likes
Message 3 of 12

psaarloos
Collaborator
Collaborator
Accepted solution

Hi,

 

You could take a look at the LifecycleEventEditor sample from the SDK. It was there until release 2017. It's not in the SDK of 2018 anymore because the functionality has been added to the transition settings in Vault. In the sample you'll be able to see how to read and write custom jobs to certain transitions. I don't know if you have 2017 somewhere, therefore I uploaded this sample for you. You can download it using this link.

 

Hope it helps!

Regards,
Pim Saarloos
Product Manager
If my post answers your question, please click the "Accept as Solution" button. Kudos are much appreciated!
0 Likes
Message 4 of 12

Anonymous
Not applicable

Thank you, I will have a look!

0 Likes
Message 5 of 12

Anonymous
Not applicable

@Anonymous, I think you made a mistake when you shared me the link, it is not what is scheduled.

 

Anyway I found the 2017 SDK, studied the code (I can't launch it step by step because the login fails), created a new project in VB (I only use it), and I succeeded to read and check the jobs in the transition I need to verify.

 

Thank you very much!

 

 

Next step, modifying the security...

0 Likes
Message 6 of 12

psaarloos
Collaborator
Collaborator

Hi,

 

Great to hear you've managed to check the jobs on the transitions. Regarding the security I can tell it will be quite some work to manage all the modifications to the security of the states and transitions. Wouldn't it be a much easier approach to create a certain 'fix' user which is disabled by default. If somebody made a mistake you could enable the 'fix' user by a small extension.

 

If there are not that many users, you could also duplicate all users, make them member of a separate group, set the security on states and transitions using this group and disable the duplicated user accounts by default. If somebody needs 'elevated permissions' to fix an error, you could simply enable the user account, and disable it afterwards.

 

Just a thought..

Regards,
Pim Saarloos
Product Manager
If my post answers your question, please click the "Accept as Solution" button. Kudos are much appreciated!
0 Likes
Message 7 of 12

Anonymous
Not applicable
Accepted solution

I don't want to use a common account for everybody, because I want to track who does what. And I also want only 1 account per person, easier to manage.

 

 

 

I succeeded to read the states security

connection.WebServiceManager.LifeCycleService.GetStateACLByLifeCycleStateId(trans.FromId)

and the transitions security

connection.WebServiceManager.LifeCycleService.GetTransitionACEsByTransitionId(trans.Id)

 

 

Now I am trying to understand how to use

connection.WebServiceManager.LifeCycleService.UpdateLifeCycleStateTransition

and

connection.WebServiceManager.LifeCycleService.UpdateLifeCycleState

but they are "not intended for public use" Smiley Sad

0 Likes
Message 8 of 12

psaarloos
Collaborator
Collaborator

That message 'not intended for public use' is something weird in the description in Visual Studio. Probably because of the extra Autodesk.Connectivity.WebServices.WCF layer. You can look up the functions in the VaultSDK.chm document in C:\Program Files (x86)\Autodesk\Autodesk Vault 2018 SDK\docs

 

 

Regards,
Pim Saarloos
Product Manager
If my post answers your question, please click the "Accept as Solution" button. Kudos are much appreciated!
0 Likes
Message 9 of 12

Anonymous
Not applicable

Problem with help is that I don't understand anything, mainly because I never learned programming....

 

I could so some things with the following, in fact I succeeded to modify the transition with nearly all previous parameters

 

connection.WebServiceManager.LifeCycleService.UpdateLifeCycleStateTransition(trans.Id, trans.Bump, trans.SyncPropOption, trans.CldState, trans.CtntState,
                        trans.ItemFileLnkUptodate, trans.ItemFileLnkState, trans.CldObsState, trans.TransBasedSec, New Long() {50} {6}, New Long() {0}, trans.RuleSet.CondArray)

 

But I don't know how to make a list of several users: it requests "ByVal allowedUserIds() As System.Long". I could place 1 user in this list with "New Long() {50}", how to do if I want to allow user #50 and user #6?

I have problems on basis programming Smiley Very Happy

 

0 Likes
Message 10 of 12

psaarloos
Collaborator
Collaborator

Hi,

 

Easiest this to create these arrays:

 

Dim sample as new List(Of Long)
sample.Add(10)
sample.Add(18)

Then convert the list to an array

 

 

sample.ToArray()

 

Hope it helps 🙂

Regards,
Pim Saarloos
Product Manager
If my post answers your question, please click the "Accept as Solution" button. Kudos are much appreciated!
0 Likes
Message 11 of 12

Anonymous
Not applicable

Wonderful, now I have all information and the beta works fine!

 

Once again, thank you very much for your help!

0 Likes
Message 12 of 12

psaarloos
Collaborator
Collaborator

Glad to hear it works! Good luck with your project.

 

Please accept the post as a solution as it might help others. Thanks.

Regards,
Pim Saarloos
Product Manager
If my post answers your question, please click the "Accept as Solution" button. Kudos are much appreciated!
0 Likes