public void Test_AccessGranted() { _testHelper.ReplayAll(); bool hasAccess = _securityClient.HasPropertyWriteAccess(_testHelper.SecurableObject, "IsVisible"); Assert.That(hasAccess, Is.True); _testHelper.VerifyAll(); }
public void Test_AccessGranted() { _testHelper.ExpectPermissionReflectorGetRequiredMethodPermissions(_methodInformation, TestAccessTypes.Second); _testHelper.ExpectObjectSecurityStrategyHasAccess(TestAccessTypes.Second, true); _testHelper.ReplayAll(); bool hasAccess = _securityClient.HasPropertyWriteAccess(_testHelper.SecurableObject, _methodInformation); Assert.That(hasAccess, Is.True); _testHelper.VerifyAll(); }
public bool CanWrite(IBusinessObject businessObject, PropertyBase bindableProperty) { // businessObject can be null ArgumentUtility.CheckNotNull("bindableProperty", bindableProperty); var securableObject = businessObject as ISecurableObject; if (securableObject == null) { return(true); } var setter = bindableProperty.PropertyInfo.GetSetMethod(true) ?? s_nullMethodInformation; return(_securityClient.HasPropertyWriteAccess(securableObject, setter)); }