2013-08-12 15:06:12 +02:00
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
using AutoMapper;
|
|
|
|
|
|
using Umbraco.Core.Services;
|
|
|
|
|
|
using Umbraco.Web.Models.ContentEditing;
|
|
|
|
|
|
using Umbraco.Web.Mvc;
|
|
|
|
|
|
using Umbraco.Web.WebApi;
|
|
|
|
|
|
using System.Linq;
|
|
|
|
|
|
|
|
|
|
|
|
namespace Umbraco.Web.Editors
|
|
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// The API controller used for using the list of sections
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
[PluginController("UmbracoApi")]
|
|
|
|
|
|
public class SectionController : UmbracoAuthorizedJsonController
|
|
|
|
|
|
{
|
|
|
|
|
|
public IEnumerable<Section> GetSections()
|
|
|
|
|
|
{
|
2014-02-07 15:45:52 +01:00
|
|
|
|
var sections = Services.SectionService.GetAllowedSections(UmbracoUser.Id);
|
|
|
|
|
|
return sections.Select(Mapper.Map<Core.Models.Section, Section>);
|
2013-08-12 15:06:12 +02:00
|
|
|
|
}
|
|
|
|
|
|
}
|
2013-07-01 14:23:56 +10:00
|
|
|
|
}
|