Beispiel #1
0
        public void CanDo(TaskE task)
        {
            switch (task)
            {
            case TaskE.Unknown:
                break;

            case TaskE.ViewService:
                break;

            case TaskE.SearchItem:
                break;

            case TaskE.NewItem:
                break;

            case TaskE.EditItem:
                break;

            case TaskE.DeleteItem:
                break;

            case TaskE.ViewItem:
                break;

            default:
                break;
            }
        }
 public void TaskETest()
 {
     Assert.Equal(1, TaskE.Solve("**.*.."));
     Assert.Equal(0, TaskE.Solve("*****"));
     Assert.Equal(0, TaskE.Solve(".*."));
     Assert.Equal(0, TaskE.Solve("..."));
     Assert.Equal(9, TaskE.Solve("*.*...*.**"));
 }
Beispiel #3
0
        public void CanDo(TaskE task)
        {
            switch (task)
            {
                case TaskE.Unknown:
                    break;
                case TaskE.ViewService:
                    break;
                case TaskE.SearchItem:
                    break;
                case TaskE.NewItem:
                    break;
                case TaskE.EditItem:
                    break;
                case TaskE.DeleteItem:
                    break;
                case TaskE.ViewItem:
                    break;
                default:
                    break;
            }

        }
Beispiel #4
0
        public bool IsAuthorize(TaskE task)
        {
            //if (User.IsInRole(RoleE.SiteAdmin))
            //{
            //    return true;
            //}

            //bool allowed = Task.HasTask(0, task);

            //if (User.IsInRole(RoleE.SiteUser))
            //{
            //    switch (task)
            //    {
            //        case TaskE.NewItem:
            //        case TaskE.EditItem:
            //        case TaskE.DeleteItem:
            //            allowed = false;
            //            break;
            //    }
            //}

            //if (User.IsInRole(RoleE.ServiceAdmin))
            //{
            //    switch (task)
            //    {
            //        case TaskE.NewItem:
            //        case TaskE.EditItem:
            //        case TaskE.DeleteItem:
            //            allowed = allowed && IsServiceAdmin;
            //            break;
            //    }
            //}

            //return allowed;

            return(false);
        }
        public static bool HasTask(int serviceID, string userName, TaskE taskID)
        {
            BaseCollection items = GetTasks(serviceID, userName).Filter("TaskID=" + ((int)taskID));

            return items.Count != 0;
        }
 public static bool HasTask(int serviceID, TaskE taskID)
 {
     return HasTask(serviceID, UWeb.UserName, taskID);
 }
 public bool HasTask(TaskE taskID)
 {
     return HasTask(Cxt.ServiceID, taskID);
 }
        public bool IsAuthorize(TaskE task)
        {
            if (User.IsInRole(RoleE.SiteAdmin))
            {
                return true;
            }

            bool allowed = Task.HasTask(Cxt.ServiceID, task);

            if (User.IsInRole(RoleE.SiteUser) && !Cxt.Service.IsPublic)
            {
                switch (task)
                {
                    case TaskE.NewItem:
                    case TaskE.EditItem:
                    case TaskE.DeleteItem:
                        allowed = false;
                        break;
                }
            }

            if (User.IsInRole(RoleE.ServiceAdmin) && !Cxt.Service.IsPublic)
            {
                switch (task)
                {
                    case TaskE.NewItem:
                    case TaskE.EditItem:
                    case TaskE.DeleteItem:
                        allowed = allowed && IsServiceAdmin;
                        break;
                }
            }

            return allowed;
        }
 public void CanDo(TaskE task)
 {
     Cxt.CanDo(task);
 }
    public void CanDo(TaskE task)
    {
        Cxt.CanDo(task);

    }
Beispiel #11
0
        public static bool HasTask(int serviceID, string userName, TaskE taskID)
        {
            BaseCollection items = GetTasks(serviceID, userName).Filter("TaskID=" + ((int)taskID));

            return(items.Count != 0);
        }
Beispiel #12
0
 public static bool HasTask(int serviceID, TaskE taskID)
 {
     return(HasTask(serviceID, UWeb.UserName, taskID));
 }
Beispiel #13
0
 public bool HasTask(TaskE taskID)
 {
     return(false);
 }