ProcessCommandAddRepository

Post your questions regarding using the Vault and Fortress API in your programs.

Moderator: SourceGear

Post Reply
ben
Posts: 18
Joined: Fri Jan 09, 2009 2:35 pm

ProcessCommandAddRepository

Post by ben » Fri Jan 09, 2009 3:00 pm

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

shannon

Re: ProcessCommandAddRepository

Post by shannon » Fri Jan 09, 2009 3:18 pm

Take a look at ProcessCommandAddUser

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

ben
Posts: 18
Joined: Fri Jan 09, 2009 2:35 pm

Re: ProcessCommandAddRepository

Post by ben » Fri Jan 09, 2009 3:37 pm

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?

shannon

Re: ProcessCommandAddRepository

Post by shannon » Fri Jan 09, 2009 3:46 pm

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?

ben
Posts: 18
Joined: Fri Jan 09, 2009 2:35 pm

Re: ProcessCommandAddRepository

Post by ben » Fri Jan 09, 2009 4:16 pm

Thanks, Shannon. I'd like to directly (not through groups) give an existing user access to an existing repository.

shannon

Re: ProcessCommandAddRepository

Post by shannon » Fri Jan 09, 2009 4:52 pm

Give this a try:

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

ben
Posts: 18
Joined: Fri Jan 09, 2009 2:35 pm

Re: ProcessCommandAddRepository

Post by ben » Sat Jan 10, 2009 6:40 pm

That worked. Thank you.

shannon

Re: ProcessCommandAddRepository

Post by shannon » Sun Jan 11, 2009 1:46 am

Great, let us know if you have any more questions.

Post Reply