AnsweredAssumed Answered

permissions.get issue with group display name value

Question asked by orodis on Dec 7, 2010
I'm doing small integration with alfresco 3.4 with out system. Shortly speaking users/groups are in one-one relation between my application and alfresco. All was fine until today when I'm trying to manage alfresco permissions via my API. The problem exists with given displayName for a group while requesting nodes permissions. My created group looks like:
{
   "data":{
         "authorityType": "GROUP",
         "shortName": "abb9ed04aa154b318b3b860238c78702",
         "fullName": "GROUP_abb9ed04aa154b318b3b860238c78702",
         "displayName": "storage.acceptance.group0",
         "isRootGroup": true,
         "isAdminGroup": false,
         "url": "/api/groups/abb9ed04aa154b318b3b860238c78702"
}
but when I assigned this group to one of my nodes my displayName is not a displayName but shortName. Request content looks like:
{
   "inherited": [
]
,
   "isInherited": false,
   "canReadInherited": false,
   "direct": [
   {
      "authority":
      {
         "name": "465742d3e7fe494cb96cf86eaa9cdea8",
         "displayName": "storage.firstname0 storage.lastName0"
      },
      "role": "Coordinator"
   },
   {
      "authority":
      {
         "name": "GROUP_abb9ed04aa154b318b3b860238c78702",
         "displayName": "abb9ed04aa154b318b3b860238c78702"
      },
      "role": "Consumer"
   }
]
,
   "settable":
   [
      "Editor","Consumer","Collaborator","Coordinator","Contributor"
   ]
}
As you can see there is no problem with assigned user displayName.
I've checked permissions.get script and I found something like:
// Resolve to group or user as appropriate
         if (authorityId.indexOf("GROUP_") === 0)
         {
            authority = Common.getGroup(authorityId);
            nameProperty = "shortName";
         }
         else
         {
            authority = Common.getPerson(authorityId);
            nameProperty = "displayName";
         }
This have also affection on share application as there is a difference between while displaying group name at groups admin console and permissions console.
Shortname is easily to get from name by stripping out GROUP_ prefix.
My question then would be If there is quick fix for that or do I need to query my database to get real displayName for groups.

Thx for any help.
Regards RG

Outcomes