Exemplo n.º 1
0
        private Permission(string fullnode)
        {
            var parsed = Perms.Parse(fullnode);

            Node        = parsed.Node;
            nodes       = Node.Split('.');
            Division    = parsed.Division;
            Description = parsed.Description;
        }
Exemplo n.º 2
0
        public RequirePermissionAttribute(PermCombination combination, params string[] node)
        {
            Combination = combination;
            Permissions = new List <Permission>();

            foreach (var p in node)
            {
                var perm = Perms.Parse(p);
                if (perm == null)
                {
                    throw new ArgumentException("Unknown permission node: " + p);
                }
                if (perm.Division != "" && DivisionStatus == PermDivisionStatus.NoDivision)
                {
                    DivisionStatus = PermDivisionStatus.RequirePermissionInContextDivision;
                }
                Permissions.Add(perm);
            }
        }
Exemplo n.º 3
0
        public PermissionUser(IUser user)
        {
            User = user;
            var sock = SocketUser(Program.CasinoGuild);

            if (sock.IsMOAInspector())
            {
                Permissions.Add(Perms.Parse(Perms.Casino.Division.MOA.All));
            }
            else if (sock.IsMOGSupervisor())
            {
                Permissions.Add(Perms.Parse(Perms.Casino.Division.MOG.All));
            }
            else if (sock.IsMOLSupervisor())
            {
                Permissions.Add(Perms.Parse(Perms.Casino.Division.MOL.All));
            }
            else if (sock.IsMOA())
            {
                Permissions.Add(Perms.Parse(Perms.Casino.Division.MOA.Employee));
            }
            else if (sock.IsMOG())
            {
                Permissions.Add(Perms.Parse(Perms.Casino.Division.MOG.Employee));
            }
            else if (sock.IsMOL())
            {
                Permissions.Add(Perms.Parse(Perms.Casino.Division.MOL.Employee));
            }
            if (sock.IsCouncilMember())
            {
                Permissions.Add(Perms.Parse(Perms.Casino.Council.Member));
            }
            if (sock.IsMember())
            {
                Permissions.Add(Perms.Parse(Perms.Casino.Member.All));
            }
            if (sock.IsAlexChester())
            {
                Permissions.Add(Perms.Parse(Perms.Casino.Division.SetBudget));
            }
        }