aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Tests/ACLTest.cs
blob: 2428b64e3b762a44b97ea12549fea0635b0761e8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
using System;
using NUnit.Framework;


namespace OpenSim.Framework.Tests
{
    [TestFixture]
    public class ACLTest
    {
        #region Tests

        /// <summary>
        /// ACL Test class
        /// </summary>
        [Test]
        public void ACLTest01()
        {
            ACL acl = new ACL();

            Role Guests = new Role("Guests");
            acl.AddRole(Guests);

            Role[] parents = new Role[1];
            parents[0] = Guests;

            Role JoeGuest = new Role("JoeGuest", parents);
            acl.AddRole(JoeGuest);

            Resource CanBuild = new Resource("CanBuild");
            acl.AddResource(CanBuild);


            acl.GrantPermission("Guests", "CanBuild");

            acl.HasPermission("JoeGuest", "CanBuild");

        }

        #endregion
    }
}