以编程方式设置Git安全性 [英] Setting Git Security Programmatically

查看:117
本文介绍了以编程方式设置Git安全性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我们目前正在尝试以编程方式修改TFS中Git的安全性。



到目前为止,我们尝试了以下两种方式:


1)



Microsoft.VisualStudio.Services.Security.Client


方法:SetAccessControlEntriesAsync


注意:这适用于TFS权限,但对于Git,行为很奇怪。


当我们运行此命令时,我们看到我们的安全性更改已应用但是当我们运行时在Web门户中查看,没有任何更改:


" C:\Program Files(x86)\ Microsoft Visual Studio 14.0 \ Common7 \IDE \ TFSSecurity.exe"    / acl" Git Repositories"存储库/ ee48ba66-240f-441a-859e-d4ed3c04748b   / collection: http://foo.net :8080 / tfs / MyCollection


Guid是相同的,但显示的安全性是不同的。


2)

解决方案

您好plbhautcoeur,


请在此提供您的详细代码。


>>如果有可能我想在C#中使用代码示例。


您可以通过C#代码运行TFSSecurity命令。


有一篇关于提取权限的文章,您可以参考它来尝试更新权限并检查结果。


https://github.com/ALM-Rangers/Extracting-effective-permissions-from-TFS /blob/master/Doc/Extracting%20effective%20permissions%20whitepaper.md


问候


Starain


Hi,

we are currently trying to modify the security for Git in TFS programmatically.

So far we have tried these two ways :

1)

Microsoft.VisualStudio.Services.Security.Client

Method : SetAccessControlEntriesAsync

Note : This worked for TFS Permissions but for Git the behavior is weird.

When we run this command we see that ours security changes are applied but when we look in the web portal, nothing have changed :

"C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\TFSSecurity.exe"  /acl "Git Repositories" repositories/ee48ba66-240f-441a-859e-d4ed3c04748b  /collection:http://foo.net:8080/tfs/MyCollection

The Guid is the same, but the security shown are differents.

2)

解决方案

Hi plbhautcoeur,

Please provide your detail code here.

>> If it's possible i'd like to have a code sample in C#.

You may run TFSSecurity command through C# code.

There is an article about extract permission, you may refer to it to try to update the permission and check the result.

https://github.com/ALM-Rangers/Extracting-effective-permissions-from-TFS/blob/master/Doc/Extracting%20effective%20permissions%20whitepaper.md

Regards

Starain


这篇关于以编程方式设置Git安全性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆