Examples of UserPermission


Examples of org.apache.hadoop.hbase.security.access.UserPermission

   *
   * @param proto the protobuf UserPermission
   * @return the converted UserPermission
   */
  public static UserPermission toUserPermission(AccessControlProtos.UserPermission proto) {
    return new UserPermission(proto.getUser().toByteArray(),
        toTablePermission(proto.getPermission()));
  }
View Full Code Here

Examples of org.glyptodon.guacamole.net.auth.permission.UserPermission

        // Add user permissions
        for(UserPermissionKey userPermission : userPermissions) {

            // Construct permission from data
            UserPermission permission = new UserPermission(
                UserPermission.Type.valueOf(userPermission.getPermission()),
                affectedUsers.get(userPermission.getAffected_user_id())
            );

            // Add to set
View Full Code Here

Examples of org.glyptodon.guacamole.net.auth.permission.UserPermission

    private Permission parseUserPermission(String str)
            throws GuacamoleException {

        // Read
        if (str.startsWith(READ_PREFIX))
            return new UserPermission(ObjectPermission.Type.READ,
                    str.substring(READ_PREFIX.length()));

        // Update
        if (str.startsWith(UPDATE_PREFIX))
            return new UserPermission(ObjectPermission.Type.UPDATE,
                    str.substring(UPDATE_PREFIX.length()));

        // Delete
        if (str.startsWith(DELETE_PREFIX))
            return new UserPermission(ObjectPermission.Type.DELETE,
                    str.substring(DELETE_PREFIX.length()));

        // Administration
        if (str.startsWith(ADMIN_PREFIX))
            return new UserPermission(ObjectPermission.Type.ADMINISTER,
                    str.substring(ADMIN_PREFIX.length()));

        throw new GuacamoleException("Invalid permission string.");

    }
View Full Code Here

Examples of org.glyptodon.guacamole.net.auth.permission.UserPermission

                // User permission
                else if (permission instanceof UserPermission) {

                    // Get permission
                    UserPermission up = (UserPermission) permission;

                    // Write permission
                    xml.writeEmptyElement("user");
                    xml.writeAttribute("type", toString(up.getType()));
                    xml.writeAttribute("name", up.getObjectIdentifier());

                }

                else
                    throw new GuacamoleClientException(
View Full Code Here

Examples of org.hive2hive.core.model.UserPermission

    Assert.assertTrue(users.contains(userProfileA.getUserId()));
    // check user permissions in case of a folder
    if (indexNew.isFolder()) {
      Set<UserPermission> permissions = ((FolderIndex) indexNew).getCalculatedUserPermissions();
      Assert.assertEquals(1, permissions.size());
      Assert.assertTrue(permissions.contains(new UserPermission(userProfileA.getUserId(),
          PermissionType.WRITE)));
    }
  }
View Full Code Here

Examples of org.hive2hive.core.model.UserPermission

    // check user permissions in case of a folder at A
    if (indexA.isFolder()) {
      Assert.assertTrue(indexA.isFolder());
      Set<UserPermission> permissions = ((FolderIndex) indexA).getCalculatedUserPermissions();
      Assert.assertEquals(2, permissions.size());
      Assert.assertTrue(permissions.contains(new UserPermission(userA.getUserId(), PermissionType.WRITE)));
      Assert.assertTrue(permissions.contains(new UserPermission(userB.getUserId(), PermissionType.READ)));
    }

    // check user permissions in case of a folder at B
    if (indexB.isFolder()) {
      Assert.assertTrue(indexB.isFolder());
      Set<UserPermission> permissions = ((FolderIndex) indexB).getCalculatedUserPermissions();
      Assert.assertEquals(2, permissions.size());
      Assert.assertTrue(permissions.contains(new UserPermission(userA.getUserId(), PermissionType.WRITE)));
      Assert.assertTrue(permissions.contains(new UserPermission(userB.getUserId(), PermissionType.READ)));
    }
  }
View Full Code Here

Examples of org.hive2hive.core.model.UserPermission

    // check user permissions in case of a folder at A
    if (newIndexAtA.isFolder()) {
      Set<UserPermission> permissions = ((FolderIndex) newIndexAtA).getCalculatedUserPermissions();
      Assert.assertEquals(2, permissions.size());
      Assert.assertTrue(permissions.contains(new UserPermission(userA.getUserId(), PermissionType.WRITE)));
      Assert.assertTrue(permissions.contains(new UserPermission(userB.getUserId(), PermissionType.READ)));
    }

    // check user permissions in case of a folder at B
    if (newIndexAtB.isFolder()) {
      Set<UserPermission> permissions = ((FolderIndex) newIndexAtB).getCalculatedUserPermissions();
      Assert.assertEquals(2, permissions.size());
      Assert.assertTrue(permissions.contains(new UserPermission(userA.getUserId(), PermissionType.WRITE)));
      Assert.assertTrue(permissions.contains(new UserPermission(userB.getUserId(), PermissionType.READ)));
    }
  }
View Full Code Here

Examples of org.hive2hive.core.model.UserPermission

    // check user permissions in case of a folder at A
    if (indexAtA.isFolder()) {
      Set<UserPermission> permissions = ((FolderIndex) indexAtA).getCalculatedUserPermissions();
      Assert.assertEquals(2, permissions.size());
      Assert.assertTrue(permissions.contains(new UserPermission(userA.getUserId(), PermissionType.WRITE)));
      Assert.assertTrue(permissions.contains(new UserPermission(userB.getUserId(), PermissionType.READ)));
    }

    // check user permissions in case of a folder at B
    if (indexAtB.isFolder()) {
      Set<UserPermission> permissions = ((FolderIndex) indexAtB).getCalculatedUserPermissions();
      Assert.assertEquals(2, permissions.size());
      Assert.assertTrue(permissions.contains(new UserPermission(userA.getUserId(), PermissionType.WRITE)));
      Assert.assertTrue(permissions.contains(new UserPermission(userB.getUserId(), PermissionType.READ)));
    }
  }
View Full Code Here

Examples of org.hive2hive.core.model.UserPermission

    // check user permissions in case of a folder at A
    if (fileAtA.isDirectory()) {
      Assert.assertTrue(indexA.isFolder());
      Set<UserPermission> permissions = ((FolderIndex) indexA).getCalculatedUserPermissions();
      Assert.assertEquals(2, permissions.size());
      Assert.assertTrue(permissions.contains(new UserPermission(userA.getUserId(), PermissionType.WRITE)));
      Assert.assertTrue(permissions.contains(new UserPermission(userB.getUserId(), PermissionType.WRITE)));
    } else {
      Assert.assertTrue(indexA.isFile());
    }

    // check user permissions in case of a folder at B
    if (fileAtB.isDirectory()) {
      Assert.assertTrue(indexB.isFolder());
      Set<UserPermission> permissions = ((FolderIndex) indexB).getCalculatedUserPermissions();
      Assert.assertEquals(2, permissions.size());
      Assert.assertTrue(permissions.contains(new UserPermission(userA.getUserId(), PermissionType.WRITE)));
      Assert.assertTrue(permissions.contains(new UserPermission(userB.getUserId(), PermissionType.WRITE)));
    } else {
      Assert.assertTrue(indexB.isFile());
    }
  }
View Full Code Here

Examples of org.hoteia.qalingo.core.domain.UserPermission

                String valueUserRole = role.getName();
                userViewBean.getRoles().put(keyUserRole, valueUserRole);

                final Set<UserPermission> permissions = role.getPermissions();
                for (Iterator<UserPermission> iteratorPermission = permissions.iterator(); iteratorPermission.hasNext();) {
                    UserPermission permission = (UserPermission) iteratorPermission.next();
                    String keyUserPermission = permission.getCode();
                    String valueUserPermission = permission.getName();
                    userViewBean.getPermissions().put(keyUserPermission, valueUserPermission);
                }
            }
        }
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.