Package com.intridea.io.vfs.operations

Examples of com.intridea.io.vfs.operations.Acl.allow()


      // Set permissions for groups
      if (item.getGrantee() instanceof GroupGrantee) {
        GroupGrantee grantee = (GroupGrantee) item.getGrantee();
        if (GroupGrantee.AllUsers.equals(grantee)) {
          // Allow rights to GUEST
          myAcl.allow(Acl.Group.EVERYONE, rights);
        } else if (GroupGrantee.AuthenticatedUsers.equals(grantee)) {
          // Allow rights to AUTHORIZED
          myAcl.allow(Acl.Group.AUTHORIZED, rights);
        }
      } else if (item.getGrantee() instanceof CanonicalGrantee) {
View Full Code Here


        if (GroupGrantee.AllUsers.equals(grantee)) {
          // Allow rights to GUEST
          myAcl.allow(Acl.Group.EVERYONE, rights);
        } else if (GroupGrantee.AuthenticatedUsers.equals(grantee)) {
          // Allow rights to AUTHORIZED
          myAcl.allow(Acl.Group.AUTHORIZED, rights);
        }
      } else if (item.getGrantee() instanceof CanonicalGrantee) {
        CanonicalGrantee grantee = (CanonicalGrantee) item.getGrantee();
        if (grantee.getIdentifier().equals(owner.getId())) {
          // The same owner and grantee understood as OWNER group
View Full Code Here

        }
      } else if (item.getGrantee() instanceof CanonicalGrantee) {
        CanonicalGrantee grantee = (CanonicalGrantee) item.getGrantee();
        if (grantee.getIdentifier().equals(owner.getId())) {
          // The same owner and grantee understood as OWNER group
          myAcl.allow(Acl.Group.OWNER, rights);
        }
      }

    }
View Full Code Here

            // Set permissions for groups
            if (item.getGrantee() instanceof GroupGrantee) {
                GroupGrantee grantee = (GroupGrantee)item.getGrantee();
                if (GroupGrantee.AllUsers.equals(grantee)) {
                    // Allow rights to GUEST
                    myAcl.allow(Acl.Group.EVERYONE, rights);
                } else if (GroupGrantee.AuthenticatedUsers.equals(grantee)) {
                    // Allow rights to AUTHORIZED
                    myAcl.allow(Acl.Group.AUTHORIZED, rights);
                }
            } else if (item.getGrantee() instanceof CanonicalGrantee) {
View Full Code Here

                if (GroupGrantee.AllUsers.equals(grantee)) {
                    // Allow rights to GUEST
                    myAcl.allow(Acl.Group.EVERYONE, rights);
                } else if (GroupGrantee.AuthenticatedUsers.equals(grantee)) {
                    // Allow rights to AUTHORIZED
                    myAcl.allow(Acl.Group.AUTHORIZED, rights);
                }
            } else if (item.getGrantee() instanceof CanonicalGrantee) {
                CanonicalGrantee grantee = (CanonicalGrantee)item.getGrantee();
                if (grantee.getIdentifier().equals(owner.getId())) {
                    // The same owner and grantee understood as OWNER group
View Full Code Here

                }
            } else if (item.getGrantee() instanceof CanonicalGrantee) {
                CanonicalGrantee grantee = (CanonicalGrantee)item.getGrantee();
                if (grantee.getIdentifier().equals(owner.getId())) {
                    // The same owner and grantee understood as OWNER group
                    myAcl.allow(Acl.Group.OWNER, rights);
                }
            }

        }
View Full Code Here

    public void testOperations () {
        Acl acl = new Acl(null);
        acl.denyAll();

        // Allow single right
        acl.allow(Acl.Group.OWNER, Acl.Permission.WRITE);
        Assert.assertTrue(acl.isAllowed(Acl.Group.OWNER, Acl.Permission.WRITE));

        // Deny single right
        acl.deny(Acl.Group.OWNER, Acl.Permission.WRITE);
        Assert.assertTrue(acl.isDenied(Acl.Group.OWNER, Acl.Permission.WRITE));
View Full Code Here

        acl.deny(Acl.Group.OWNER, Acl.Permission.WRITE);
        Assert.assertTrue(acl.isDenied(Acl.Group.OWNER, Acl.Permission.WRITE));

        // Allow rights
        Acl.Permission[] rights = {Acl.Permission.READ, Acl.Permission.WRITE};
        acl.allow(Acl.Group.AUTHORIZED, rights);
        Assert.assertTrue(acl.isAllowed(Acl.Group.AUTHORIZED, Acl.Permission.WRITE));
        Assert.assertTrue(acl.isAllowed(Acl.Group.AUTHORIZED, Acl.Permission.READ));

        // Deny rights
        acl.deny(Acl.Group.AUTHORIZED, rights);
View Full Code Here

        acl.deny(Acl.Group.AUTHORIZED, rights);
        Assert.assertTrue(acl.isDenied(Acl.Group.AUTHORIZED, Acl.Permission.WRITE));
        Assert.assertTrue(acl.isDenied(Acl.Group.AUTHORIZED, Acl.Permission.READ));

        // Allow all to group
        acl.allow(Acl.Group.AUTHORIZED);
        Assert.assertTrue(acl.isAllowed(Acl.Group.AUTHORIZED, Acl.Permission.WRITE));
        Assert.assertTrue(acl.isAllowed(Acl.Group.AUTHORIZED, Acl.Permission.READ));

        // Deny all to group
        acl.deny(Acl.Group.AUTHORIZED);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.