/// <summary> /// Gets the specified client setting using the resolution as specified via the option. /// This resolution kicks in, in case there are more groups the user is part of and allows /// to indicate whether the highest or lowest value needs to be picked /// </summary> private TResult GetTypedValue <TResult>(string settingId, AuthorizationRoleClientSettingValueSelectionOption option, TResult defaultValue) { try { var val = GetValue(settingId, option, defaultValue); return((TResult)val); } catch { } return(defaultValue); }
/// <summary> /// Gets the specified client setting using the resolution as specified via the option. /// This resolution kicks in, in case there are more groups the user is part of and allows /// to indicate whether the highest or lowest value needs to be picked /// </summary> private object GetValue(string settingId, AuthorizationRoleClientSettingValueSelectionOption option, object defaultValue) { object result = defaultValue; if (Roles != null) { result = Roles.GetClientSettingValue(settingId, option) ?? result; } return((defaultValue is Int32) ? Int32.Parse(result.ToString()) : result); }