Page 1 of 1

ProcessCommandAddRepository

Posted: Fri Jan 09, 2009 3:00 pm
by ben
I am creating a test client for Vault using the API. I am able to successfully add a repository. My question: how to I add a user to the repository so he/she can access it?

Regards,
Ben

Re: ProcessCommandAddRepository

Posted: Fri Jan 09, 2009 3:18 pm
by shannon
Take a look at ProcessCommandAddUser

Note, you'll need to be logged in as admin to use it.

Re: ProcessCommandAddRepository

Posted: Fri Jan 09, 2009 3:37 pm
by ben
I guess I should have been more specific. How do I give a user permission to access the newly created repository? I think ProcessCommandAddUser is just for adding a new user to the Vault database, not for giving a user access to a specified repository. Correct?

Re: ProcessCommandAddRepository

Posted: Fri Jan 09, 2009 3:46 pm
by shannon
Yes, ProcessCommandAddUser is for adding a new user. When you add a user with ProcessCommandAddUser, they'll be given the default rights to the repository. If that's set to access, then they get access, etc.

There's more than one way to give a user rights to a repository. Are you wanting to do it directly (Access, None, Full Admin) or through groups?

Re: ProcessCommandAddRepository

Posted: Fri Jan 09, 2009 4:16 pm
by ben
Thanks, Shannon. I'd like to directly (not through groups) give an existing user access to an existing repository.

Re: ProcessCommandAddRepository

Posted: Fri Jan 09, 2009 4:52 pm
by shannon
Give this a try:

ServerOperations.client.ClientInstance.Connection.AddRepositoryAccess(repid, userid, false, VaultRepositoryAccess.Access);

Re: ProcessCommandAddRepository

Posted: Sat Jan 10, 2009 6:40 pm
by ben
That worked. Thank you.

Re: ProcessCommandAddRepository

Posted: Sun Jan 11, 2009 1:46 am
by shannon
Great, let us know if you have any more questions.