コード例 #1
0
        public NavigationNode(string action, string controller, string title, object allowedRole = null)
            : this()
        {
            Action     = action;
            Controller = controller;
            Title      = title;

            if (allowedRole != null)
            {
                AllowedRoles.Add(allowedRole);
            }
        }
コード例 #2
0
        public JsonSerialiseAttribute(params UserRole[] allowedRoles)
        {
            if (allowedRoles.Contains(UserRole.None))
            {
                AllowedRoles = new List <UserRole>();
                return;
            }

            AllowedRoles = allowedRoles.ToList();

            if (!AllowedRoles.Contains(UserRole.Realogy))
            {
                AllowedRoles.Add(UserRole.Realogy);
            }
        }