use of org.apache.jackrabbit.oak.spi.security.principal.PrincipalImpl in project jackrabbit-oak by apache.
the class CugExcludeDefaultTest method testMixedPrincipals.
@Test
public void testMixedPrincipals() {
Set<Principal> principals = new HashSet<Principal>();
principals.add(new PrincipalImpl("test"));
principals.add(new SystemUserPrincipal() {
@Override
public String getName() {
return "test";
}
});
assertTrue(exclude.isExcluded(principals));
}
use of org.apache.jackrabbit.oak.spi.security.principal.PrincipalImpl in project jackrabbit-oak by apache.
the class LoginWithMembersTest method beforeSuite.
@Override
public void beforeSuite() throws Exception {
super.beforeSuite();
Session s = loginAdministrative();
try {
UserManager userManager = ((JackrabbitSession) s).getUserManager();
Authorizable user = userManager.getAuthorizable(USER);
Group gr = userManager.createGroup(new PrincipalImpl(GROUP), "test");
gr.addMember(user);
// add other members to this group which the test user is not member of.
for (int i = 1; i < numberOfMembers; i++) {
Group g = userManager.createGroup(new PrincipalImpl(GROUP + i), "test");
gr.addMember(g);
}
s.save();
} finally {
s.logout();
}
}
use of org.apache.jackrabbit.oak.spi.security.principal.PrincipalImpl in project jackrabbit-oak by apache.
the class GetAuthorizableByPrincipalTest method runTest.
@Override
protected void runTest() throws Exception {
Session s = loginWriter();
UserManager userManager = ((JackrabbitSession) s).getUserManager();
for (int i = 0; i < 1000; i++) {
Authorizable a = userManager.getAuthorizable(new PrincipalImpl(getUserId()));
}
}
use of org.apache.jackrabbit.oak.spi.security.principal.PrincipalImpl in project jackrabbit-oak by apache.
the class FindAuthorizableWithScopeTest method beforeSuite.
@Override
protected void beforeSuite() throws Exception {
adminSession = loginWriter();
userMgr = ((JackrabbitSession) adminSession).getUserManager();
Group gr = userMgr.createGroup(GROUP_ID, new PrincipalImpl(GROUP_ID), "test");
for (int i = 0; i < numberOfUsers; i++) {
User u = userMgr.createUser("testUser" + i, null, new PrincipalImpl("testUser" + i), "test");
gr.addMember(u);
}
adminSession.save();
}
use of org.apache.jackrabbit.oak.spi.security.principal.PrincipalImpl in project jackrabbit-oak by apache.
the class AddMembersTest method beforeSuite.
@Override
public void beforeSuite() throws Exception {
super.beforeSuite();
Session s = loginAdministrative();
try {
UserManager userManager = ((JackrabbitSession) s).getUserManager();
for (int i = 0; i <= GROUP_CNT; i++) {
Group g = userManager.createGroup(new PrincipalImpl(GROUP + i), REL_TEST_PATH);
groupPaths.add(g.getPath());
}
createUsers(userManager);
} finally {
s.save();
s.logout();
}
System.out.println("setup done");
}
Aggregations