Package org.apache.jackrabbit.oak.spi.security.authorization.permission

Examples of org.apache.jackrabbit.oak.spi.security.authorization.permission.ReadStatus


    boolean canReadThisNode() {
        return getReadStatus().includes(ReadStatus.ALLOW_THIS);
    }

    boolean canReadAllProperties() {
        ReadStatus rs = getReadStatus();
        return rs.includes(ReadStatus.ALLOW_PROPERTIES);
    }
View Full Code Here


        ReadStatus rs = getReadStatus();
        return rs.includes(ReadStatus.ALLOW_PROPERTIES);
    }

    boolean canReadProperty(PropertyState property) {
        ReadStatus rs = getReadStatus();
        if (rs.includes(ReadStatus.ALLOW_PROPERTIES)) {
            return true;
        } else if (rs.appliesToThis()) {
            rs = permissionProvider.getReadStatus(base, property);
            return rs.isAllow();
        } else {
            return false;
        }
    }
View Full Code Here

public class ReadStatusTest {

    @Test
    public void testAllowAll() {
        ReadStatus allowAll = ReadStatus.ALLOW_ALL;

        assertTrue(allowAll.includes(ReadStatus.ALLOW_THIS));
        assertTrue(allowAll.includes(ReadStatus.ALLOW_CHILDREN));
        assertTrue(allowAll.includes(ReadStatus.ALLOW_NODES));
        assertTrue(allowAll.includes(ReadStatus.ALLOW_PROPERTIES));
        assertTrue(allowAll.includes(ReadStatus.ALLOW_THIS_PROPERTIES));
        assertTrue(allowAll.includes(ReadStatus.ALLOW_CHILDITEMS));
        assertTrue(allowAll.includes(ReadStatus.ALLOW_ALL_REGULAR));
        assertTrue(allowAll.includes(ReadStatus.ALLOW_ACCESS_CONTROL));
        assertTrue(allowAll.includes(ReadStatus.ALLOW_ALL));
    }
View Full Code Here

        return compiledPermissions.isGranted(acTree, acProperty, Permissions.READ_ACCESS_CONTROL);
    }

    private ReadStatus getVersionContentReadStatus(@Nonnull Tree versionStoreTree, @Nullable PropertyState property) {
        TreeLocation location = getLocation(versionStoreTree, property);
        ReadStatus status = ReadStatus.DENY_THIS;
        if (location != null) {
            Tree tree = (property == null) ? location.getTree() : location.getParent().getTree();
            if (tree != null) {
                status = compiledPermissions.getReadStatus(tree, property);
            } else {
View Full Code Here

        return compiledPermissions.isGranted(acTree, acProperty, Permissions.READ_ACCESS_CONTROL);
    }

    private ReadStatus getVersionContentReadStatus(@Nonnull Tree versionStoreTree, @Nullable PropertyState property) {
        TreeLocation location = getVersionableLocation(versionStoreTree, property);
        ReadStatus status;
        if (location != null) {
            Tree tree = (property == null) ? location.getTree() : location.getParent().getTree();
            if (tree == null) {
                long permission = (property == null) ? Permissions.READ_NODE : Permissions.READ_PROPERTY;
                if (compiledPermissions.isGranted(location.getPath(), permission)) {
View Full Code Here

        return compiledPermissions.isGranted(acTree, acProperty, Permissions.READ_ACCESS_CONTROL);
    }

    private ReadStatus getVersionContentReadStatus(@Nonnull Tree versionStoreTree, @Nullable PropertyState property) {
        TreeLocation location = getVersionableLocation(versionStoreTree, property);
        ReadStatus status;
        if (location != null) {
            Tree tree = (property == null) ? location.getTree() : location.getParent().getTree();
            if (tree == null) {
                long permission = (property == null) ? Permissions.READ_NODE : Permissions.READ_PROPERTY;
                if (compiledPermissions.isGranted(location.getPath(), permission)) {
View Full Code Here

*/
public class ReadStatusTest {

    @Test
    public void testAllowAll() {
        ReadStatus allowAll = ReadStatus.ALLOW_ALL;

        assertTrue(allowAll.includes(ReadStatus.ALLOW_THIS));
        assertTrue(allowAll.includes(ReadStatus.ALLOW_CHILDREN));
        assertTrue(allowAll.includes(ReadStatus.ALLOW_NODES));
        assertTrue(allowAll.includes(ReadStatus.ALLOW_PROPERTIES));
        assertTrue(allowAll.includes(ReadStatus.ALLOW_THIS_PROPERTIES));
        assertTrue(allowAll.includes(ReadStatus.ALLOW_CHILDITEMS));
        assertTrue(allowAll.includes(ReadStatus.ALLOW_ALL_REGULAR));
        assertTrue(allowAll.includes(ReadStatus.ALLOW_ACCESS_CONTROL));
        assertTrue(allowAll.includes(ReadStatus.ALLOW_ALL));
    }
View Full Code Here

        return compiledPermissions.isGranted(acTree, acProperty, Permissions.READ_ACCESS_CONTROL);
    }

    private ReadStatus getVersionContentReadStatus(@Nonnull Tree versionStoreTree, @Nullable PropertyState property) {
        TreeLocation location = getVersionableLocation(versionStoreTree, property);
        ReadStatus status;
        if (location != null) {
            Tree tree = (property == null) ? location.getTree() : location.getParent().getTree();
            if (tree == null) {
                long permission = (property == null) ? Permissions.READ_NODE : Permissions.READ_PROPERTY;
                if (compiledPermissions.isGranted(location.getPath(), permission)) {
View Full Code Here

TOP

Related Classes of org.apache.jackrabbit.oak.spi.security.authorization.permission.ReadStatus

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.