Skip to content

Commit

Permalink
fixed SecurityContext
Browse files Browse the repository at this point in the history
  • Loading branch information
acoburn committed Sep 4, 2015
1 parent ac1bc9c commit bb95cfe
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
Expand Up @@ -57,9 +57,8 @@ protected FedoraWebACUserSecurityContext(final Principal userPrincipal,
* @see org.modeshape.jcr.security.SecurityContext#hasRole(String)
*/
@Override
public final boolean hasRole(final String roleName) {
public boolean hasRole(final String roleName) {
LOGGER.debug("Checking hasRole({})", roleName);

if (WEBAC_MODE_READ_VALUE.equals(roleName)) {
return true;
} else if (WEBAC_MODE_WRITE_VALUE.equals(roleName)) {
Expand All @@ -69,7 +68,7 @@ public final boolean hasRole(final String roleName) {
} else if (WEBAC_MODE_CONTROL_VALUE.equals(roleName)) {
return true;
}
return false;
return super.hasRole(roleName);
}

}
Expand Up @@ -22,7 +22,7 @@

import javax.jcr.Session;

//import org.fcrepo.auth.common.FedoraUserSecurityContext;
import org.fcrepo.auth.common.FedoraUserSecurityContext;
import org.fcrepo.auth.roles.common.AbstractRolesAuthorizationDelegate;

import org.slf4j.Logger;
Expand Down Expand Up @@ -78,9 +78,9 @@ public Principal getEveryonePrincipal() {
return EVERYONE;
}

//@Override
//public FedoraUserSecurityContext getFedoraUserSecurityContext(final Principal userPrincipal) {
//return new FedoraWebACUserSecurityContext(userPrincipal, this);
//}
@Override
public FedoraUserSecurityContext getFedoraUserSecurityContext(final Principal userPrincipal) {
return new FedoraWebACUserSecurityContext(userPrincipal, this);
}

}

0 comments on commit bb95cfe

Please sign in to comment.