Adds getAllPropertyEditors to datatype resource

This commit is contained in:
Per Ploug
2015-06-17 22:20:41 +02:00
parent 05d554d8a6
commit d5cfefca39
2 changed files with 27 additions and 0 deletions

View File

@@ -135,6 +135,16 @@ function dataTypeResource($q, $http, umbDataFormatter, umbRequestHelper) {
'Failed to retrieve data');
},
getAllPropertyEditors: function () {
return umbRequestHelper.resourcePromise(
$http.get(
umbRequestHelper.getApiUrl(
"dataTypeApiBaseUrl",
"GetAllPropertyEditors")),
'Failed to retrieve data');
},
/**
* @ngdoc method
* @name umbraco.resources.contentResource#getScaffold

View File

@@ -114,6 +114,23 @@ namespace Umbraco.Web.Editors
.Select(Mapper.Map<PropertyEditorBasic>);
}
/// <summary>
/// Gets the content json for all property editors
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
/// <remarks>
/// Permission is granted to this method if the user has access to any of these trees: DataTypes, Content or Media
/// </remarks>
[UmbracoTreeAuthorize(Constants.Trees.DataTypes, Constants.Trees.Content, Constants.Trees.Media)]
public IEnumerable<PropertyEditorBasic> GetAllPropertyEditors()
{
return PropertyEditorResolver.Current.PropertyEditors
.OrderBy(x => x.Name)
.Select(Mapper.Map<PropertyEditorBasic>);
}
/// <summary>
/// Deletes a data type wth a given ID
/// </summary>