using System;
using System.Collections.Generic;
using System.ComponentModel;
namespace Csla.Security
{
  /// 
  /// Maintains authorization roles for a business object
  /// or business object type.
  /// 
  public class AuthorizationRulesManager
  {
    private Dictionary _rules;
    internal Dictionary RulesList
    {
      get
      {
        if (_rules == null)
          _rules = new Dictionary();
        return _rules;
      }
    }
    #region Get Roles
    internal RolesForProperty GetRolesForProperty(string propertyName)
    {
      RolesForProperty currentRoles = null;
      if (!RulesList.ContainsKey(propertyName))
      {
        currentRoles = new RolesForProperty();
        RulesList.Add(propertyName, currentRoles);
      }
      else
        currentRoles = RulesList[propertyName];
      return currentRoles;
    }
    #endregion
  }
}