私はAngpをAsp.net MVCで使用して、ユーザーのフォルダの書き込みアクセスをチェックしています。ユーザーに書き込みアクセス権がある場合は、リンクを持つdivを表示したいと思います。私はSampleView.HtmlのDivを持っており、MVC ControllerのReportController.csというユーザーの書き込みアクセスをチェックするメソッドがあります。 MVCコントローラからAngularjsビューに値を渡すために使用できる角度コントローラのコードは何ですか?MVCコントローラの値をAngular.htmlに渡す方法
SampleView.html:
<div id="DivPackerTemplate" class="cp-btn cp-btn-primary pull-right"><a ng-href="\\Samplefolder" >Edit Template</a></div>
ReportController.cs:
public void AccessPackerPlanTemplate(string folderPath)
{
string path = @"\\sample";
string NtAccountName = @"sampleuser";
DirectoryInfo di = new DirectoryInfo(path);
DirectorySecurity acl = di.GetAccessControl(AccessControlSections.All);
AuthorizationRuleCollection rules = acl.GetAccessRules(true, true, typeof(NTAccount));
//Go through the rules returned from the DirectorySecurity
foreach (AuthorizationRule rule in rules)
{
//If we find one that matches the identity we are looking for
if (rule.IdentityReference.Value.Equals(NtAccountName, StringComparison.CurrentCultureIgnoreCase))
{
//Cast to a FileSystemAccessRule to check for access rights
if ((((FileSystemAccessRule)rule).FileSystemRights & FileSystemRights.WriteData) > 0)
{
//Show the link
{
DivPackerTemplate.Visible = false; \\This is not working is there a alternative for this?
}
}
}
}
あなたは私に私が使用できる任意のサンプルのための参照を与えることができますか? – Programmermid