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("*.*...*.**")); }
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 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(false); }