得到了答案here。我可以在BCS模式設置字段是WindowsSecurityDescriptorField,然後我可以使用自定義代碼在我的BCS方法來創建一個訪問控制列表:
Byte[] GetSecurityDescriptor(string domain, string username)
{
NTAccount acc = new NTAccount(domain, username);
var sid = (SecurityIdentifier)acc.Translate(typeof(SecurityIdentifier));
CommonSecurityDescriptor sd = new CommonSecurityDescriptor(false, false,
ControlFlags.None,sid,null, null, null);
sd.SetDiscretionaryAclProtection(true, false);
//Deny access to everyone
SecurityIdentifier everyone = new SecurityIdentifier(
WellKnownSidType.WorldSid, null);
sd.DiscretionaryAcl.RemoveAccess(AccessControlType.Allow, everyone,
unchecked((int)0xffffffffL), InheritanceFlags.None, PropagationFlags.None);
//Grant full access to specified user
sd.DiscretionaryAcl.AddAccess(AccessControlType.Allow, sid,
unchecked((int)0xffffffffL), InheritanceFlags.None, PropagationFlags.None);
byte[] secDes = new Byte[sd.BinaryLength];
sd.GetBinaryForm(secDes, 0);
return secDes;
}
這工作得很好,讓我一次,我翻譯的用戶創建自定義的ACL在後端系統和Active Directory之間。
我仍然有興趣聽到如果某人如果將安全性作爲BCS模型的一部分有其他方式。
忽然想知道bcs ... – 2010-04-12 17:59:37