This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Linq; | |
using System.Security.Cryptography; | |
using System.Text; | |
namespace Utilities | |
{ | |
/// <summary> | |
/// Simple utility class for generating hashes for string values. | |
/// </summary> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class RandomDataSet | |
{ | |
private int seed, compCount; | |
private List<int> idataset = new List<int>(); | |
/// <summary> | |
/// Default constructor. | |
/// </summary> | |
public RandomDataSet() | |
: this( new List<int>(), 0, System.DateTime.Now.Millisecond ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections; | |
using System.Linq; | |
using System.Xml.Linq; | |
/// <summary>Represent an Exception as XML data.</summary> | |
public class ExceptionXElement : XElement | |
{ | |
/// <summary>Create an instance of ExceptionXElement.</summary> | |
/// <param name="exception">The Exception to serialize.</param> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Imports System.Collections.Generic | |
Imports System.IO | |
Imports System.Security.Cryptography | |
Imports System.Text | |
Namespace Security | |
''' <summary> | |
''' OpenSSL AES CBC 256 in .NET for interop with Ruby | |
''' </summary> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"vars": { | |
"@gray-darker": "lighten(#000, 13.5%)", | |
"@gray-dark": "lighten(#000, 20%)", | |
"@gray": "lighten(#000, 33.5%)", | |
"@gray-light": "lighten(#000, 46.7%)", | |
"@gray-lighter": "lighten(#000, 93.5%)", | |
"@brand-primary": "#428bca", | |
"@brand-success": "#5cb85c", | |
"@brand-info": "#5bc0de", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public partial class SecurityProvider | |
{ | |
public static bool ActionIsAllowedForUser(string controllerName, string actionName) | |
{ | |
var configuration = SecurityConfiguration.Get<MvcConfiguration>(); | |
var policyContainer = configuration.Runtime.PolicyContainers.GetContainerFor(controllerName, actionName); | |
if (policyContainer != null) | |
{ | |
var results = policyContainer.EnforcePolicies(configuration.CreateContext()); | |
return results.All(x => x.ViolationOccured == false); |
NewerOlder