title: TFS 2012 API - Set Version Control Permissions?
body: <p>I am trying to set the various version control permissions of a TFS item via the TFS API. Here is the code I am using that successfully sets the read and checkout permissions for the given folder path:</p>
  
  <pre><code>        IIdentityManagementService ims = tpc.GetService&lt;IIdentityManagementService&gt;();
          TeamFoundationIdentity userIdentity = ims.ReadIdentity(IdentitySearchFactor.AccountName,
                                                  "Guest",
                                                  MembershipQuery.None,
                                                  ReadIdentityOptions.IncludeReadFromSource);
  
          ISecurityService ss = tpc.GetService&lt;ISecurityService&gt;();
          SecurityNamespace securityNamespace = ss.GetSecurityNamespace(SecurityConstants.RepositorySecurityNamespaceGuid);
  
          securityNamespace.SetPermissions(folderPath, userIdentity.Descriptor, RegistryServicePermissions.AllPermissions, 0, true);
  </code></pre>
  
  <p>What I don't understand is the value to use in the 3rd parameter (the "allow" parameter) of SetPermissions in order to set various things such as checkin, manage branch, etc. the MSDN documentation is vary vague.</p>
  
  <pre><code>    public abstract AccessControlEntry SetPermissions(
              string token,
              IdentityDescriptor descriptor,
              int allow,
              int deny,
              bool merge
      )
  </code></pre>
  
  <p>The description for the "allow" parameter simply says:</p>
  
  <pre><code>    allow
      Type: System.Int32
  </code></pre>
  
  <p>Any help is greatly appreciated.</p>