Free cookie consent management tool by TermsFeed Policy Generator

source: trunk/sources/HeuristicLab.Hive.Server.Core/3.2/Authorization/PolicyCollection.cs @ 2476

Last change on this file since 2476 was 2100, checked in by mbecirov, 15 years ago

#586: Fixed authorization when no policy scope is defined.

File size: 837 bytes
Line 
1using System;
2using System.Collections.Generic;
3using System.Linq;
4using System.Text;
5using System.Collections;
6
7namespace HeuristicLab.Hive.Server.Core {
8  public class PolicyCollection : IEnumerable<Policy> {
9    private IList<Policy> _policies = new List<Policy>();
10
11    public IList<Policy> Policies { get { return this._policies; } }
12
13    public Policy this[string name] {
14      get {
15        foreach (Policy item in _policies) {
16          if (item.Name == name)
17            return item;
18        }
19        return null;
20      }
21    }
22
23    public IEnumerator<Policy> GetEnumerator() {
24      return this._policies.GetEnumerator();
25    }
26
27    #region IEnumerable Members
28
29    IEnumerator IEnumerable.GetEnumerator()
30    {
31        return this._policies.GetEnumerator();
32    }
33
34    #endregion
35  }
36}
Note: See TracBrowser for help on using the repository browser.