Guest fixes

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@2173 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Andrew Hind
2006-01-23 11:27:32 +00:00
parent 5f50bb6d0a
commit 9d432121bc
4 changed files with 47 additions and 3 deletions

View File

@@ -16,7 +16,7 @@
<cm:homeFolder>/${spaces.company_home.childname}</cm:homeFolder> <cm:homeFolder>/${spaces.company_home.childname}</cm:homeFolder>
</cm:person> </cm:person>
<cm:person view:childName="cm:person"> <cm:person view:childName="cm:person">
<cm:userName>Guest</cm:userName> <cm:userName>guest</cm:userName>
<cm:firstName>Guest</cm:firstName> <cm:firstName>Guest</cm:firstName>
<cm:lastName></cm:lastName> <cm:lastName></cm:lastName>
<cm:email></cm:email> <cm:email></cm:email>

View File

@@ -425,7 +425,6 @@ public class PermissionServiceImpl implements PermissionServiceSPI, Initializing
// TODO: Refactor and use the authentication service for this. // TODO: Refactor and use the authentication service for this.
User user = (User) auth.getPrincipal(); User user = (User) auth.getPrincipal();
auths.add(user.getUsername()); auths.add(user.getUsername());
auths.add(getAllAuthorities());
for (GrantedAuthority authority : auth.getAuthorities()) for (GrantedAuthority authority : auth.getAuthorities())
{ {
auths.add(authority.getAuthority()); auths.add(authority.getAuthority());

View File

@@ -63,6 +63,51 @@ public class PersonTest extends BaseSpringTest
{ {
super.onTearDownInTransaction(); super.onTearDownInTransaction();
flushAndClear(); flushAndClear();
}
public void xtestPerformance()
{
personService.setCreateMissingPeople(false);
personService.createPerson(createDefaultProperties("derek", "Derek", "Hulley", "dh@dh",
"alfresco", rootNodeRef));
long create = 0;
long count = 0;
long start;
long end;
for(int i = 0; i < 10000; i++)
{
String id = "TestUser-"+i;
start = System.nanoTime();
personService.createPerson(createDefaultProperties(id, id, id, id,
id, rootNodeRef));
end = System.nanoTime();
create += (end - start);
if((i > 0) && (i % 100 == 0))
{
System.out.println("Count = "+i);
System.out.println("Average create : "+(create/i/1000000.0f));
start = System.nanoTime();
personService.personExists(id);
end = System.nanoTime();
System.out.println("Exists : "+((end-start)/1000000.0f));
start = System.nanoTime();
int size = personService.getAllPeople().size();
end = System.nanoTime();
System.out.println("Size ("+size+") : "+((end-start)/1000000.0f));
}
}
} }
public void testCreateMissingPeople1() public void testCreateMissingPeople1()

View File

@@ -219,7 +219,7 @@ public enum AuthorityType
{ {
authorityType = AuthorityType.OWNER; authorityType = AuthorityType.OWNER;
} }
else if (authority.equals(PermissionService.GUEST)) else if (authority.equalsIgnoreCase(PermissionService.GUEST))
{ {
authorityType = AuthorityType.GUEST; authorityType = AuthorityType.GUEST;
} }