use of org.apache.jackrabbit.api.security.user.Authorizable in project jackrabbit-oak by apache.
the class MemberBaseTest method afterSuite.
@Override
public void afterSuite() throws Exception {
Session s = loginAdministrative();
try {
Authorizable authorizable = ((JackrabbitSession) s).getUserManager().getAuthorizable(GROUP + "0");
if (authorizable != null) {
Node n = s.getNode(Text.getRelativeParent(authorizable.getPath(), 1));
n.remove();
}
authorizable = ((JackrabbitSession) s).getUserManager().getAuthorizable(USER + "0");
if (authorizable != null) {
Node n = s.getNode(Text.getRelativeParent(authorizable.getPath(), 1));
n.remove();
}
s.save();
} finally {
s.logout();
}
}
use of org.apache.jackrabbit.api.security.user.Authorizable in project jackrabbit-oak by apache.
the class LoginWithMembershipTest method afterSuite.
@Override
public void afterSuite() throws Exception {
Session s = loginAdministrative();
try {
Authorizable authorizable = ((JackrabbitSession) s).getUserManager().getAuthorizable(GROUP);
if (authorizable != null) {
Node n = s.getNode(Text.getRelativeParent(authorizable.getPath(), 1));
n.remove();
}
s.save();
} finally {
s.logout();
}
}
use of org.apache.jackrabbit.api.security.user.Authorizable in project jackrabbit-oak by apache.
the class GetGroupPrincipalsTest method beforeSuite.
@Override
public void beforeSuite() throws Exception {
super.beforeSuite();
session = loginAdministrative();
UserManager userManager = ((JackrabbitSession) session).getUserManager();
Authorizable user = userManager.getAuthorizable(USER);
if (user == null) {
user = userManager.createUser(USER, USER);
principalName = user.getPrincipal().getName();
}
// make sure we have a least a single group the user is member of.
Group gr = userManager.createGroup(new PrincipalImpl(GROUP), "test");
gr.addMember(user);
for (int i = 1; i < numberOfGroups; i++) {
Group g = userManager.createGroup(new PrincipalImpl(GROUP + i), "test");
if (!nestedGroups) {
g.addMember(user);
} else {
g.addMember(gr);
}
gr = g;
}
session.save();
}
use of org.apache.jackrabbit.api.security.user.Authorizable in project jackrabbit-oak by apache.
the class RemoveMembersTest method afterSuite.
@Override
public void afterSuite() throws Exception {
Session s = loginAdministrative();
try {
Authorizable authorizable = ((JackrabbitSession) s).getUserManager().getAuthorizable(GROUP + "0");
if (authorizable != null) {
Node n = s.getNode(Text.getRelativeParent(authorizable.getPath(), 1));
n.remove();
}
// remove test-users if they have been created
authorizable = ((JackrabbitSession) s).getUserManager().getAuthorizable(USER + "0");
if (authorizable != null) {
Node n = s.getNode(Text.getRelativeParent(authorizable.getPath(), 1));
n.remove();
}
s.save();
} finally {
s.logout();
}
}
use of org.apache.jackrabbit.api.security.user.Authorizable in project jackrabbit-oak by apache.
the class AddMembersTest method afterSuite.
@Override
public void afterSuite() throws Exception {
Session s = loginAdministrative();
try {
Authorizable authorizable = ((JackrabbitSession) s).getUserManager().getAuthorizable(GROUP + "0");
if (authorizable != null) {
Node n = s.getNode(Text.getRelativeParent(authorizable.getPath(), 1));
n.remove();
}
if (!ImportBehavior.NAME_BESTEFFORT.equals(importBehavior)) {
authorizable = ((JackrabbitSession) s).getUserManager().getAuthorizable(USER + "0");
if (authorizable != null) {
Node n = s.getNode(Text.getRelativeParent(authorizable.getPath(), 1));
n.remove();
}
}
s.save();
} finally {
s.logout();
}
}
Aggregations