コード例 #1
0
 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);
 }
コード例 #2
0
ファイル: Tasks.cs プロジェクト: Inzaghi2012/teamlab.v7.5
        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));
        }
コード例 #3
0
        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;
        }
コード例 #4
0
        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);
        }
コード例 #5
0
        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);
        }
コード例 #6
0
        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);
        }
コード例 #7
0
 public static void TeamSecurity(Project project, Participant participant)
 {
     DropProjectActivitiesCache(project);
 }
コード例 #8
0
        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);
        }
コード例 #9
0
        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);
        }