Click here to Skip to main content
15,909,324 members
Home / Discussions / C#
   

C#

 
GeneralRe: caching data on server in windows application in c# Pin
siva45525-May-11 2:03
siva45525-May-11 2:03 
GeneralRe: caching data on server in windows application in c# Pin
Pete O'Hanlon25-May-11 2:19
mvePete O'Hanlon25-May-11 2:19 
GeneralRe: caching data on server in windows application in c# [modified] Pin
siva45525-May-11 19:02
siva45525-May-11 19:02 
GeneralRe: caching data on server in windows application in c# Pin
Pete O'Hanlon25-May-11 21:44
mvePete O'Hanlon25-May-11 21:44 
AnswerRe: caching data on server in windows application in c# Pin
Luc Pattyn25-May-11 1:30
sitebuilderLuc Pattyn25-May-11 1:30 
AnswerRe: caching data on server in windows application in c# Pin
PIEBALDconsult25-May-11 2:50
mvePIEBALDconsult25-May-11 2:50 
AnswerRe: caching data on server in windows application in c# Pin
jschell25-May-11 10:16
jschell25-May-11 10:16 
QuestionTFS GetEffectivePermission and TF14014: Cannot query effective item or global permissions for other users. Pin
devvvy24-May-11 16:26
devvvy24-May-11 16:26 
I'm coding up a small script to list users' (all users in our group) permission on each TFS project. I relied on "GetEffectivePermissions" http://msdn.microsoft.com/en-us/library/microsoft.teamfoundation.versioncontrol.client.versioncontrolserver.geteffectivepermissions(v=vs.90).aspx

However, after research a little I found out that this API can only be called with "userName" = $YOURSELF$

Any attempt to call "GetEffectivePermission" would result in
TF14014: Cannot query effective item or global permissions for other users.

Any suggestion on how to get around this??

<br />
using System;<br />
using System.Collections.Generic;<br />
using System.Linq;<br />
using System.Text;<br />
<br />
// Add reference to TFS dll's under: C:\Program Files (x86)\Microsoft Visual Studio 8\Common7\IDE\PrivateAssemblies<br />
using Microsoft.TeamFoundation;<br />
using Microsoft.TeamFoundation.Client;<br />
using Microsoft.TeamFoundation.VersionControl;<br />
using Microsoft.TeamFoundation.VersionControl.Common;<br />
using Microsoft.TeamFoundation.VersionControl.Client;<br />
<br />
namespace ManageTFS<br />
{<br />
    class Program<br />
    {<br />
        static void Main(string[] args)<br />
        {<br />
            /*<br />
                  <a href="http://msdn.microsoft.com/en-us/library/bb141847(v=VS.90).aspx">MSDN Visual Studio 2008 TEam Foundation Core Services</a>[<a href="http://msdn.microsoft.com/en-us/library/bb141847(v=VS.90).aspx" target="_blank" title="New Window">^</a>]<br />
             */<br />
            string TFSConnString = "http://SomeSErver:8080/";<br />
            IList<string> PermissionOwners = new List<string>();<br />
            string UserName = null;<br />
            string[] EffectivePermissions = null;<br />
            IDictionary<string, IList<string>> PermissionsDict = new Dictionary<string, IList<string>>();<br />
<br />
            try<br />
            {<br />
                TeamFoundationServer TfsInstance = new TeamFoundationServer(TFSConnString);<br />
                Console.WriteLine("Connected to TFS " + TFSConnString);<br />
<br />
                VersionControlServer vcs = (VersionControlServer)TfsInstance.GetService(typeof(VersionControlServer));<br />
                Console.WriteLine("Connected to VersionControlServer");<br />
<br />
                TeamProject[] Projects = vcs.GetAllTeamProjects(true);<br />
                Console.WriteLine("Retrieved TFS projects from VersionControlServer");<br />
<br />
                PermissionOwners.Add("john.doe");<br />
                PermissionOwners.Add("bill.clinton");<br />
                PermissionOwners.Add("me.me");<br />
                foreach(string Owner in PermissionOwners)<br />
                {<br />
                    foreach (TeamProject p in Projects)<br />
                    {    <br />
                        Console.WriteLine(p.ServerItem);<br />
                        EffectivePermissions = vcs.GetEffectivePermissions(Owner, p.ServerItem); (BLOWS UP HERE)<br />
<br />
                        PermissionsDict.Add(UserName, EffectivePermissions);<br />
                    }<br />
                }<br />
            }<br />
            catch (Exception Ex)<br />
            {<br />
                Console.WriteLine(Ex);<br />
            }<br />
<br />
            return;<br />
        }<br />
    }<br />
}<br />

dev

QuestionWorking with multiple values in one field in an Access database Pin
Matt U.24-May-11 11:50
Matt U.24-May-11 11:50 
AnswerRe: Working with multiple values in one field in an Access database Pin
Paladin200024-May-11 12:12
Paladin200024-May-11 12:12 
GeneralRe: Working with multiple values in one field in an Access database Pin
Matt U.24-May-11 13:36
Matt U.24-May-11 13:36 
GeneralRe: Working with multiple values in one field in an Access database Pin
V.25-May-11 1:33
professionalV.25-May-11 1:33 
AnswerRe: Working with multiple values in one field in an Access database Pin
Roger Wright25-May-11 19:39
professionalRoger Wright25-May-11 19:39 
Questionconcatenate the word document, it's possible? Pin
abbd24-May-11 7:03
abbd24-May-11 7:03 
AnswerRe: concatenate the word document, it's possible? Pin
Eddy Vluggen25-May-11 0:19
professionalEddy Vluggen25-May-11 0:19 
AnswerRe: concatenate the word document, it's possible? Pin
Alan N25-May-11 2:05
Alan N25-May-11 2:05 
AnswerRe: concatenate the word document, it's possible? Pin
Dave Kreskowiak25-May-11 2:59
mveDave Kreskowiak25-May-11 2:59 
GeneralRe: concatenate the word document, it's possible? Pin
Alan N25-May-11 4:06
Alan N25-May-11 4:06 
GeneralRe: concatenate the word document, it's possible? Pin
Dave Kreskowiak25-May-11 6:22
mveDave Kreskowiak25-May-11 6:22 
AnswerRe: concatenate the word document, it's possible? Pin
RaviRanjanKr26-May-11 1:55
professionalRaviRanjanKr26-May-11 1:55 
GeneralRe: concatenate the word document, it's possible? Pin
abbd26-May-11 2:33
abbd26-May-11 2:33 
QuestionProblem in Deserializing the XML Pin
Rocky2324-May-11 4:06
Rocky2324-May-11 4:06 
AnswerRe: Problem in Deserializing the XML Pin
PIEBALDconsult24-May-11 5:32
mvePIEBALDconsult24-May-11 5:32 
Questionhow to make multiple asynchronous web service method calls in the same thread? [modified] Pin
JUNEYT24-May-11 2:57
JUNEYT24-May-11 2:57 
AnswerRe: how to make multiple asynchronous web service method calls in the same thread? [modified] Pin
Mark Salsbery24-May-11 5:27
Mark Salsbery24-May-11 5:27 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.