locked
Finding users of a project and their source control permissions RRS feed

  • Question

  • Hi,

    I want to find the users that use the source cotrol of a particular project programtically.
    E.g. I want to show that a,b,c,d,e are the users of project xyz and they have Checkin, Label and Lock Permissions.

    How can this be done?

    Manasi

    Thursday, December 7, 2006 3:45 AM

Answers

  • Hi:

    Unfortunately there is nothing in the GUI that will give you this so my best guess is that you will need to write against the Object Model to get this data.  Your best bet is to download the Visual Studio SDK and then go through the Version Control dll help files to see how you want to accomplish the task. It will not be trivial so have that in mind.

    If you want a cheaper way then just use the permissions to give you that information.  In there you can see all the users that are allowed to use version control but you would not necessarily know if they used it or not. In there you can also get a view of their permissions.

    Thanks, mario

     

    Wednesday, December 13, 2006 12:22 AM
    Moderator

All replies

  • Hi:

    Unfortunately there is nothing in the GUI that will give you this so my best guess is that you will need to write against the Object Model to get this data.  Your best bet is to download the Visual Studio SDK and then go through the Version Control dll help files to see how you want to accomplish the task. It will not be trivial so have that in mind.

    If you want a cheaper way then just use the permissions to give you that information.  In there you can see all the users that are allowed to use version control but you would not necessarily know if they used it or not. In there you can also get a view of their permissions.

    Thanks, mario

     

    Wednesday, December 13, 2006 12:22 AM
    Moderator
  • As far as I know, you cannot do it easily programmatically for any user. For currently logged in user there is useful method of VersionControlServer called GetEffectivePermissions (see James Manning post on the issue).

    You probably can implement sort of GetEffectivePermissions for any user - for that you could retrieve user's group membership (using IGroupSecurityService ) and permissions set for specific item path (using GetPermissions method of VersionControlServer) and then compute the effective permissions for the user, but that is not an easy work.

    I have started some kind of tool doing it, but never finished it. If you think that will be useful, let me know and I will try to release something usable or perhaps pass you the sources.

    Regards, Eugene

    Wednesday, December 13, 2006 5:51 AM
  • After much investigation I found out that permissions can not be assigned to individual users. Permissions are assigned to groups and users are then adde to groups.
    Wednesday, December 13, 2006 12:36 PM
  • Yes they can!  What problems are you having?
    Wednesday, December 13, 2006 6:55 PM
    Moderator
  • I want to assign individual permissions to individual users of the project. I have to provide a UI as follows:-

    Imagine a grid where row headers are the names of the users (mark, rachel etc)and column headers are the permissions (eg. read, pendchange, check-in etc). Each cell in the grid contains a check-box. Now whenever I check a check box in a cell, a permission corresponding to that column should get assign to user corresponding to the row.

    Is this possible through code?

    Manasi

    Monday, December 18, 2006 12:27 PM
  • Is there an answer to Manasai's final question?  Where is code sample?  Thanks in advance.
    Wednesday, December 12, 2007 9:31 PM