Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
272 additions
and
221 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
fcrepo-kernel-impl/src/main/java/org/fcrepo/kernel/impl/rdf/impl/AclRdfContext.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
package org.fcrepo.kernel.impl.rdf.impl; | ||
|
||
import org.fcrepo.kernel.rdf.IdentifierTranslator; | ||
|
||
import javax.jcr.Node; | ||
import javax.jcr.RepositoryException; | ||
import java.security.AccessControlException; | ||
|
||
import static com.hp.hpl.jena.datatypes.xsd.XSDDatatype.XSDboolean; | ||
import static com.hp.hpl.jena.graph.NodeFactory.createLiteral; | ||
import static com.hp.hpl.jena.graph.Triple.create; | ||
import static org.fcrepo.kernel.RdfLexicon.WRITABLE; | ||
|
||
/** | ||
* @author cabeer | ||
* @since 10/1/14 | ||
*/ | ||
public class AclRdfContext extends NodeRdfContext { | ||
/** | ||
* Default constructor. | ||
* | ||
* @param node | ||
* @param graphSubjects | ||
* @throws javax.jcr.RepositoryException | ||
*/ | ||
public AclRdfContext(final Node node, final IdentifierTranslator graphSubjects) throws RepositoryException { | ||
super(node, graphSubjects); | ||
|
||
// include writable status | ||
concatWritable(); | ||
} | ||
|
||
private void concatWritable() throws RepositoryException { | ||
boolean writable = false; | ||
try { | ||
node().getSession().checkPermission( node().getPath(), "add_node,set_property,remove" ); | ||
writable = true; | ||
} catch ( AccessControlException ex ) { | ||
writable = false; | ||
} | ||
|
||
concat(create(subject(), WRITABLE.asNode(), createLiteral(String.valueOf(writable), XSDboolean))); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.