AuthorizeProjectUser() 공개 정적인 메소드

public static AuthorizeProjectUser ( int projectId ) : void
projectId int
리턴 void
        public static void AuthorizeProjectUser(int[] projectIds)
        {
            var userId =
                ((IBusinessIdentity)Csla.ApplicationContext.User.Identity).UserId;

            ProjectUserRepository.AuthorizeProjectUser(projectIds, userId);
        }
예제 #2
0
        public static StatusInfoList StatusFetchInfoList(int projectId)
        {
            ProjectUserRepository.AuthorizeProjectUser(projectId);

            return(StatusInfoList.FetchStatusInfoList(
                       new StatusDataCriteria
            {
                ProjectId = projectId
            }));
        }
        public static ProjectUserInfoList ProjectUserFetchInfoList(int projectId)
        {
            ProjectUserRepository.AuthorizeProjectUser(projectId);

            return(ProjectUserInfoList.FetchProjectUserInfoList(
                       new ProjectUserMemberDataCriteria
            {
                ProjectId = projectId
            }));
        }
예제 #4
0
        public static SprintInfoList SprintFetchInfoList(IProject project)
        {
            ProjectUserRepository.AuthorizeProjectUser(project.ProjectId);

            return(SprintInfoList.FetchSprintInfoList(
                       new SprintDataCriteria
            {
                ProjectId = new[] { project.ProjectId }
            }));
        }
예제 #5
0
        public static StoryInfoList StoryFetchInfoList(ISprint sprint)
        {
            ProjectUserRepository.AuthorizeProjectUser(sprint.ProjectId);

            return(StoryInfoList.FetchStoryInfoList(
                       new StoryDataCriteria
            {
                ProjectId = new[] { sprint.ProjectId },
                SprintId = sprint.SprintId
            }));
        }
예제 #6
0
        public static StoryInfoList StoryFetchInfoList(IProject project, bool?isArchived)
        {
            ProjectUserRepository.AuthorizeProjectUser(project.ProjectId);

            return(StoryInfoList.FetchStoryInfoList(
                       new StoryDataCriteria
            {
                ProjectId = new[] { project.ProjectId },
                IsArchived = isArchived
            }));
        }
예제 #7
0
        public static SprintInfoList SprintFetchInfoList(IProject[] projects, bool?isArchived)
        {
            var projectIds = projects.Select(row => row.ProjectId).ToArray();

            ProjectUserRepository.AuthorizeProjectUser(projectIds);

            return(SprintInfoList.FetchSprintInfoList(
                       new SprintDataCriteria
            {
                ProjectId = projectIds,
                IsArchived = isArchived
            }));
        }
예제 #8
0
        public static bool SprintDelete(Sprint sprint)
        {
            ProjectUserRepository.AuthorizeProjectUser(sprint.ProjectId);

            Sprint.DeleteSprint(
                new SprintDataCriteria
            {
                SprintId = sprint.SprintId
            });

            FeedRepository.FeedAdd(FeedAction.Deleted, sprint);

            return(true);
        }
        public static Project ProjectFetch(int projectId)
        {
            ProjectUserRepository.AuthorizeProjectUser(projectId);

            var result = Project.FetchProject(
                new ProjectDataCriteria
            {
                ProjectId = projectId
            });

            result.Auditor = new ProjectAuditor(result.Clone());

            return(result);
        }
예제 #10
0
        public static bool StoryDelete(Story story)
        {
            ProjectUserRepository.AuthorizeProjectUser(story.ProjectId);

            Story.DeleteStory(
                new StoryDataCriteria
            {
                StoryId = story.StoryId
            });

            FeedRepository.FeedAdd(FeedAction.Deleted, story);

            return(true);
        }
예제 #11
0
        public static bool ProjectDelete(Project project)
        {
            ProjectUserRepository.AuthorizeProjectUser(project.ProjectId);

            Project.DeleteProject(
                new ProjectDataCriteria
            {
                ProjectId = project.ProjectId
            });

            FeedRepository.FeedAdd(FeedAction.Deleted, project);

            return(true);
        }
예제 #12
0
        public static Project ProjectUpdate(Project project)
        {
            if (!project.IsDirty)
            {
                return(project);
            }

            ProjectUserRepository.AuthorizeProjectUser(project.ProjectId);

            project = project.Save();

            SourceRepository.SourceUpdate(project.ProjectId, SourceType.Project, project.Name);

            FeedRepository.FeedAdd(FeedAction.Edited, project);

            return(project);
        }
예제 #13
0
        public static Status StatusUpdate(Status status)
        {
            if (!status.IsDirty)
            {
                return(status);
            }

            ProjectUserRepository.AuthorizeProjectUser(status.ProjectId);

            status = status.Save();

            SourceRepository.SourceUpdate(status.StatusId, SourceType.Status, status.Name);

            FeedRepository.FeedAdd(FeedAction.Edited, status);

            return(status);
        }
        public static bool ProjectUserDelete(ProjectUser projectUser)
        {
            ProjectUserRepository.AuthorizeProjectUser(projectUser.ProjectId);

            if (ProjectUserRepository.ProjectUserFetch(
                    projectUser.ProjectId, projectUser.UserId).RoleId == (int)Role.Owner)
            {
                throw new NotSupportedException("You cannot delete the owner of a project");
            }

            ProjectUser.DeleteProjectUser(
                new ProjectUserMemberDataCriteria
            {
                ProjectUserMemberId = projectUser.ProjectUserMemberId
            });

            FeedRepository.FeedAdd(FeedAction.Deleted, projectUser);

            return(true);
        }
예제 #15
0
        public static Sprint SprintSave(Sprint sprint)
        {
            if (!sprint.IsValid)
            {
                return(sprint);
            }

            ProjectUserRepository.AuthorizeProjectUser(sprint.ProjectId);

            Sprint result;

            if (sprint.IsNew)
            {
                result = SprintRepository.SprintInsert(sprint);
            }
            else
            {
                result = SprintRepository.SprintUpdate(sprint);
            }

            return(result);
        }
        public static ProjectUser ProjectUserSave(ProjectUser projectUser)
        {
            if (!projectUser.IsValid)
            {
                return(projectUser);
            }

            ProjectUserRepository.AuthorizeProjectUser(projectUser.ProjectId);

            ProjectUser result;

            if (projectUser.IsNew)
            {
                result = ProjectUserRepository.ProjectUserInsert(projectUser);
            }
            else
            {
                result = ProjectUserRepository.ProjectUserUpdate(projectUser);
            }

            return(result);
        }
예제 #17
0
        public static Story StorySave(Story story)
        {
            if (!story.IsValid)
            {
                return(story);
            }

            ProjectUserRepository.AuthorizeProjectUser(story.ProjectId);

            Story result;

            if (story.IsNew)
            {
                result = StoryRepository.StoryInsert(story);
            }
            else
            {
                result = StoryRepository.StoryUpdate(story);
            }

            return(result);
        }