コード例 #1
0
        public async Task <IHttpActionResult> GetProjectRolesAsync(int projectId)
        {
            await _privilegesManager.DemandAny(Session.UserId, projectId, InstanceAdminPrivileges.AccessAllProjectsAdmin,
                                               ProjectAdminPrivileges.ViewGroupsAndRoles);

            var result = await _instanceRepository.GetProjectRolesAsync(projectId);

            return(Ok(result));
        }
コード例 #2
0
        public async Task <IHttpActionResult> GetProjectGroupsAsync(int projectId, [FromUri] Pagination pagination,
                                                                    [FromUri] Sorting sorting, string search = null)
        {
            pagination.Validate();
            SearchFieldValidator.Validate(search);

            await _privilegesManager.DemandAny(Session.UserId, projectId, InstanceAdminPrivileges.AccessAllProjectsAdmin,
                                               ProjectAdminPrivileges.ViewGroupsAndRoles);

            var tabularData = new TabularData {
                Pagination = pagination, Sorting = sorting, Search = search
            };
            var result =
                await _groupRepository.GetProjectGroupsAsync(projectId, tabularData, SortingHelper.SortProjectGroups);

            return(Ok(result));
        }