public PermissionEntity getPermission(String permissionName) {

    for (PermissionEntity permissionEntity : permissions) {
      if (permissionEntity.getPermissionName().equals(permissionName)) {
        return permissionEntity;
      }
    }
    return null;
  }
Get the permission entity for the given permission name.

@param permissionName  the permission name

@return the matching permission entity or null
ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ViewEntity.java