AnsweredAssumed Answered

How to work permissionProperty in InlineEditProperty Widget

Question asked by janaka1984 on Oct 7, 2016
Latest reply on Oct 7, 2016 by ddraper

Hi,

i have used following widget. but i have no idea how to fill "node.permissions.user.Write". currently  i used my own json file to read site data

please give me hint how to do that?

 

{

                                                              id: "MY_PROJECT_ID",

                                                              name: "alfresco/renderers/InlineEditProperty",

                                                              config: {

                                                                 propertyToRender: "customProperties.stcp:ProjectID.value",

                                                                 permissionProperty: "node.permissions.user.Write",

                                                                 refreshCurrentItem: true,

                                                                 requirementConfig: {

                                                                    initialValue: true

                                                                 },

                                                               

 

------------------------------------------------------

mytest.get.json.ftl

 

{

    "list" : {

                <#assign length = sites?size>

                <#assign skipCount = pagination.skipCount>

                <#assign maxItems = pagination.maxItems>

                <#assign userid=person.properties.userName>

               

                "pagination" : {

                        "count" : "${length}",

                        "hasMoreItems" : "false",

                        "totalItems" : "${length}",

                        "skipCount" :"${skipCount}",

                        "maxItems" : "${maxItems}"

                    },

                "entries" :[

                    <#list sites?sort_by("shortName") as site>

                        {

                        "entry" :{

                       

                            "user":"${userid}",

                            "url": "${url.serviceContext + "/api/sites/" + site.shortName}",

                            "sitePreset": "${site.sitePreset}",

                            "shortName": "${site.shortName}",

                            "title": "${site.title}",

                            "description": "${site.description}",

                            "isPublic": ${site.isPublic?string("true", "false")},

                            <#if site.node?exists>

                            "node": "${url.serviceContext + "/api/node/" + site.node.storeType + "/" + site.node.storeId + "/" + site.node.id}",

                            "tagScope": "${url.serviceContext + "/api/tagscopes/" + site.node.storeType + "/" + site.node.storeId + "/" + site.node.id}",

                            </#if>

                           

                            "siteRole": "${site.getMembersRole(userid)!""}",

                           

                           

                            "isPublic": ${site.isPublic?string("true", "false")},                           

                            "visibility": "${site.visibility}"                           

                            <#if site.customProperties?size != 0>,

                            "customProperties":{

                                <#list site.customProperties?keys as prop>

                                <#assign propDetails = site.customProperties[prop]>

                                <#assign s = prop>

                                "${s?replace('{http://www.alfresco.org/model/sitecustomproperty/1.0}', 'stcp:')}":

                                {

                                    "name": "${prop}",

                                    "value":

                                    <#if propDetails.value?is_enumerable>

                                    [

                                    <#list propDetails.value as v>

                                    "${v?string}"<#if v_has_next>,</#if>

                                    </#list>

                                    ]

                                    <#else>

                                    "${propDetails.value?string}"

                                    </#if>,

                                    "type": <#if propDetails.type??>"${propDetails.type}"<#else>null</#if>,

                                    "title": <#if propDetails.title??>"${propDetails.title}"<#else>null</#if>

                                }

                                <#if prop_has_next>,</#if>

                                </#list>

                            }

                            </#if>       

                           

                        }

                        }

                        <#if site_has_next>,</#if>

                       

                    </#list>

                ]

        }

       

    }

 

 

regards

janaka

Outcomes