Merged HEAD-BUG-FIX (4.3/Cloud) to HEAD (4.3/Cloud)

57228: Merged V4.2-BUG-FIX (4.2.1) to HEAD-BUG-FIX (Cloud/4.3)
      57067: Merged V4.1-BUG-FIX (4.1.7) to V4.2-BUG-FIX (4.2.1)
         56942: Merged DEV to V4.1-BUG-FIX (4.1.7)
            56883 : MNT-9794: Authorities with duplicate names can be easilly created using « AuthorityService »
               - Creation of the duplicated authorities is fixed. Unit tests are added.


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@61783 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Alan Davis
2014-02-11 20:17:00 +00:00
parent 1230bde9a6
commit 71791b0c00
2 changed files with 35 additions and 1 deletions

View File

@@ -606,7 +606,13 @@ public class AuthorityServiceImpl implements AuthorityService, InitializingBean
{
checkTypeIsMutable(type);
String name = getName(type, shortName);
authorityDAO.createAuthority(name, authorityDisplayName, authorityZones);
//MNT-9794 fix. If authority with 'name' doesn't exist it will be created
if (!authorityDAO.authorityExists(name))
{
authorityDAO.createAuthority(name, authorityDisplayName, authorityZones);
}
return name;
}