mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Fix for ALF-11104: add authenticated user to authorisations list in PermissionService + fix inconsistency in AuthorityService
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@31751 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -768,6 +768,8 @@ public class PermissionServiceImpl extends AbstractLifecycleBean implements Perm
|
||||
String username = user.getUsername();
|
||||
Set<String> auths = authorityService.getAuthoritiesForUser(username);
|
||||
|
||||
auths.add(username);
|
||||
|
||||
for (GrantedAuthority grantedAuthority : auth.getAuthorities())
|
||||
{
|
||||
auths.add(grantedAuthority.getAuthority());
|
||||
|
@@ -62,7 +62,19 @@ public class PermissionServiceTest extends AbstractPermissionTest
|
||||
super();
|
||||
// TODO Auto-generated constructor stub
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Tests that the current user is contained in the current authorisations set
|
||||
*/
|
||||
public void testCurrentUserAuthority()
|
||||
{
|
||||
runAs("andy");
|
||||
assertEquals("andy", authenticationComponent.getCurrentUserName());
|
||||
|
||||
Set<String> authorisations = permissionService.getAuthorisations();
|
||||
assertTrue("", authorisations.contains("andy"));
|
||||
}
|
||||
|
||||
public void testMove()
|
||||
{
|
||||
runAs("admin");
|
||||
|
Reference in New Issue
Block a user