return hasRole(token, (SubjectNode)getPrincipal(token), role);
}
// overwrites super
public boolean hasRole(SlideToken token, SubjectNode subjectNode, String role) throws ServiceAccessException, ObjectNotFoundException {
SubjectNode roleNode = null;
if (namespaceConfig.getRolesPath() != null && namespaceConfig.getRolesPath().length() != 0) {
roleNode = SubjectNode.getSubjectNode(namespaceConfig.getRolesPath()+"/"+role);
}
if (roleNode != null && matchPrincipal(token, subjectNode, roleNode)) {
return true;
}
else {
// check groups
SubjectNode groupNode = null;
if (namespaceConfig.getGroupsPath() != null && namespaceConfig.getGroupsPath().length() != 0) {
groupNode = SubjectNode.getSubjectNode(namespaceConfig.getGroupsPath()+"/"+role);
}
return (groupNode != null && matchPrincipal(token, subjectNode, groupNode));
}