public void Test_WithParamsArray() { _testHelper.ReplayAll(); bool hasAccess = _securityClient.HasAccess(_testHelper.SecurableObject, AccessType.Get(TestAccessTypes.First)); _testHelper.VerifyAll(); Assert.That(hasAccess, Is.EqualTo(true)); }
private IEnumerable <T> FilterByAccess <T> (IEnumerable <T> securableObjects, params Enum[] requiredAccessTypeEnums) where T : ISecurableObject { SecurityClient securityClient = SecurityClient.CreateSecurityClientFromConfiguration(); AccessType[] requiredAccessTypes = Array.ConvertAll(requiredAccessTypeEnums, AccessType.Get); return(securableObjects.Where(o => securityClient.HasAccess(o, requiredAccessTypes))); }