ProcessCommandAddRepository
Moderator: SourceGear
ProcessCommandAddRepository
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
Regards,
Ben
Re: ProcessCommandAddRepository
Take a look at ProcessCommandAddUser
Note, you'll need to be logged in as admin to use it.
Note, you'll need to be logged in as admin to use it.
Re: ProcessCommandAddRepository
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
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?
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
Thanks, Shannon. I'd like to directly (not through groups) give an existing user access to an existing repository.
Re: ProcessCommandAddRepository
Give this a try:
ServerOperations.client.ClientInstance.Connection.AddRepositoryAccess(repid, userid, false, VaultRepositoryAccess.Access);
ServerOperations.client.ClientInstance.Connection.AddRepositoryAccess(repid, userid, false, VaultRepositoryAccess.Access);
Re: ProcessCommandAddRepository
That worked. Thank you.