public ParticipantWrapper(Participant participant) : base(participant.UserInfo) { CanReadFiles = participant.CanReadFiles; CanReadMilestones = participant.CanReadMilestones; CanReadMessages = participant.CanReadMessages; CanReadTasks = participant.CanReadTasks; CanReadContacts = participant.CanReadContacts; IsAdministrator = ProjectSecurity.IsAdministrator(participant.ID); }
public void SaveOrUpdateTest() { var daoFactory = new DaoFactory("projects", 0); var task = daoFactory.GetTaskDao().GetById(187); var participant = new Participant(SecurityContext.CurrentAccount.ID); Console.WriteLine(task.UniqID); daoFactory.GetParticipantDao().Read(participant.ID, task.UniqID, DateTime.Now); Console.WriteLine(daoFactory.GetParticipantDao().WhenReaded(participant.ID, task.UniqID)); }
public virtual bool GetTeamSecurity(Project project, Participant participant, ProjectTeamSecurity teamSecurity) { if (project == null) throw new ArgumentNullException("project"); if (participant == null) throw new ArgumentNullException("participant"); var security = projectDao.GetTeamSecurity(project.ID, participant.ID); return (security & teamSecurity) != teamSecurity; }
public virtual void SetTeamSecurity(Project project, Participant participant, ProjectTeamSecurity teamSecurity, bool visible) { if (project == null) throw new ArgumentNullException("project"); if (participant == null) throw new ArgumentNullException("participant"); ProjectSecurity.DemandEditTeam(project); var security = projectDao.GetTeamSecurity(project.ID, participant.ID); if (visible) { if (security != ProjectTeamSecurity.None) security ^= teamSecurity; } else { security |= teamSecurity; } projectDao.SetTeamSecurity(project.ID, participant.ID, security); }
public virtual void RemoveFromTeam(Project project, Participant participant, bool sendNotification) { if (project == null) throw new ArgumentNullException("project"); if (participant == null) throw new ArgumentNullException("participant"); ProjectSecurity.DemandEditTeam(project); projectDao.RemoveFromTeam(project.ID, participant.ID); if (!factory.DisableNotifications && sendNotification) NotifyClient.Instance.SendRemovingFromProjectTeam(participant.ID, project); }
public virtual void AddToTeam(Project project, Participant participant, bool sendNotification) { if (project == null) throw new ArgumentNullException("project"); if (participant == null) throw new ArgumentNullException("participant"); ProjectSecurity.DemandEditTeam(project); projectDao.AddToTeam(project.ID, participant.ID); if (!factory.DisableNotifications && sendNotification && !project.Responsible.Equals(participant.ID) && participant.ID != SecurityContext.CurrentAccount.ID) NotifyClient.Instance.SendInvaiteToProjectTeam(participant.ID, project); }
public static void TeamSecurity(Project project, Participant participant) { DropProjectActivitiesCache(project); }
public virtual void RemoveFromTeam(Project project, Participant participant, bool sendNotification) { if (project == null) throw new ArgumentNullException("project"); if (participant == null) throw new ArgumentNullException("participant"); ProjectSecurity.DemandEditTeam(project); projectDao.RemoveFromTeam(project.ID, participant.ID); TimeLinePublisher.Team(project, participant.UserInfo, EngineResource.ActionText_DeletedFromTeam); if (!_factory.DisableNotifications && sendNotification) NotifyClient.Instance.SendRemovingFromProjectTeam(participant.ID, project); }
public virtual void AddToTeam(Project project, Participant participant, bool sendNotification) { if (project == null) throw new ArgumentNullException("project"); if (participant == null) throw new ArgumentNullException("participant"); ProjectSecurity.DemandEditTeam(project); projectDao.AddToTeam(project.ID, participant.ID); TimeLinePublisher.Team(project, participant.UserInfo, EngineResource.ActionText_AddToTeam); if (!_factory.DisableNotifications && sendNotification && !project.Responsible.Equals(participant.ID)) NotifyClient.Instance.SendInvaiteToProjectTeam(participant.ID, project); }