示例#1
0
 public AuthorizationKeyImpl(IAuthorizationService service, IAuthorizationKey parent, String key, String caption, int order)
 {
     _service         = service;
     _parent          = parent;
     AuthorizationKey = key;
     Caption          = caption;
     Order            = order;
     SubKeys          = new ReadOnlyCollection <IAuthorizationKey>(_items);
 }
 public AuthorizationKeyImpl(IAuthorizationService service, IAuthorizationKey parent, String key, String caption, int order)
 {
     _service = service;
     _parent = parent;
     AuthorizationKey = key;
     Caption = caption;
     Order = order;
     SubKeys = new ReadOnlyCollection<IAuthorizationKey>(_items);
 }
        private AuthorizationStatus GetStatus(String type, string name, IAuthorizationKey key)
        {
            var cacheKey = String.Format("{0}:{1}:{2}", type, name, key.AuthorizationKey);
            AuthorizationStatus result = AuthorizationStatus.Deny;

            if (_cache.TryGetValue(cacheKey, out result))
            {
                var model = GetModel(type, name, key.AuthorizationKey, false);
                if (model != null)
                {
                    result = model.Status;
                }
                _cache[cacheKey] = result;
            }
            return(result);
        }
 private AuthorizationStatus GetStatus(String type, string name, IAuthorizationKey key)
 {
     var cacheKey = String.Format("{0}:{1}:{2}", type, name, key.AuthorizationKey);
     AuthorizationStatus result = AuthorizationStatus.Deny;
     if (_cache.TryGetValue(cacheKey, out result))
     {
         var model = GetModel(type, name, key.AuthorizationKey, false);
         if (model != null)
             result = model.Status;
         _cache[cacheKey] = result;
     }
     return result;
 }
示例#5
0
 internal void AddItem(IAuthorizationKey item)
 {
     _items.Add(item);
 }
 internal void AddItem(IAuthorizationKey item)
 {
     _items.Add(item);
 }