Examples of DBModelAuthorizable


Examples of org.apache.sentry.core.model.db.DBModelAuthorizable

  public static Iterable<DBModelAuthorizable> parseRole(String string) {
    List<DBModelAuthorizable> result = Lists.newArrayList();
    for(String section : AUTHORIZABLE_SPLITTER.split(string)) {
      // XXX this ugly hack is because action is not an authorizeable
      if(!section.toLowerCase().startsWith(PRIVILEGE_PREFIX)) {
        DBModelAuthorizable authorizable = DBModelAuthorizables.from(section);
        if(authorizable == null) {
          String msg = "No authorizable found for " + section;
          throw new ConfigurationException(msg);
        }
        result.add(authorizable);
View Full Code Here

Examples of org.apache.sentry.core.model.db.DBModelAuthorizable

    String action = "ALL";//AccessConstants.ALL;
    for (String privilege : ROLE_SPLITTER.split(privileges)) {
      for(String section : AUTHORIZABLE_SPLITTER.split(privilege)) {
        // action is not an authorizeable
        if(!section.toLowerCase().startsWith(PRIVILEGE_PREFIX)) {
          DBModelAuthorizable dbAuthorizable = DBModelAuthorizables.from(section);
          if(dbAuthorizable == null) {
            throw new IOException("Unknown Auth type " + section);
          }

          if (DBModelAuthorizable.AuthorizableType.Server.equals(dbAuthorizable.getAuthzType())) {
            serverName = dbAuthorizable.getName();
          } else if (DBModelAuthorizable.AuthorizableType.Db.equals(dbAuthorizable.getAuthzType())) {
            dbName = dbAuthorizable.getName();
          } else if (DBModelAuthorizable.AuthorizableType.Table.equals(dbAuthorizable.getAuthzType())) {
            tableName = dbAuthorizable.getName();
          } else if (DBModelAuthorizable.AuthorizableType.URI.equals(dbAuthorizable.getAuthzType())) {
            uriPath = dbAuthorizable.getName();
          } else {
            throw new IOException("Unsupported auth type " + dbAuthorizable.getName()
                + " : " + dbAuthorizable.getTypeName());
          }
        } else {
          action = DBModelAction.valueOf(
              StringUtils.removePrefix(section, PRIVILEGE_PREFIX).toUpperCase())
              .toString();
View Full Code Here

Examples of org.apache.sentry.core.model.db.DBModelAuthorizable

    String action = AccessConstants.ALL;
    for (String privilege : ROLE_SPLITTER.split(privileges)) {
      for (String section : AUTHORIZABLE_SPLITTER.split(privilege)) {
        // action is not an authorizeable
        if (!section.toLowerCase().startsWith(PRIVILEGE_PREFIX)) {
          DBModelAuthorizable dbAuthorizable = DBModelAuthorizables
              .from(section);
          if (dbAuthorizable == null) {
            throw new IOException("Unknow Auth type " + section);
          }

          if (AuthorizableType.Server.equals(dbAuthorizable.getAuthzType())) {
            serverName = dbAuthorizable.getName();
          } else if (AuthorizableType.Db.equals(dbAuthorizable.getAuthzType())) {
            dbName = dbAuthorizable.getName();
          } else if (AuthorizableType.Table.equals(dbAuthorizable
              .getAuthzType())) {
            tableName = dbAuthorizable.getName();
          } else if (AuthorizableType.URI.equals(dbAuthorizable.getAuthzType())) {
            uriPath = dbAuthorizable.getName();
          } else {
            throw new IOException("Unsupported auth type "
                + dbAuthorizable.getName() + " : "
                + dbAuthorizable.getTypeName());
          }
        } else {
          action = DBModelAction
              .valueOf(
                  StringUtils.removePrefix(section, PRIVILEGE_PREFIX)
View Full Code Here

Examples of org.apache.sentry.core.model.db.DBModelAuthorizable

  public static Iterable<DBModelAuthorizable> parsePrivilege(String string) {
    List<DBModelAuthorizable> result = Lists.newArrayList();
    for(String section : AUTHORIZABLE_SPLITTER.split(string)) {
      // XXX this ugly hack is because action is not an authorizeable
      if(!section.toLowerCase().startsWith(PRIVILEGE_PREFIX)) {
        DBModelAuthorizable authorizable = DBModelAuthorizables.from(section);
        if(authorizable == null) {
          String msg = "No authorizable found for " + section;
          throw new ConfigurationException(msg);
        }
        result.add(authorizable);
View Full Code Here

Examples of org.apache.sentry.core.model.db.DBModelAuthorizable

          String uri = null;
          String action = AccessConstants.ALL;
          for (String authorizable : PolicyFileConstants.AUTHORIZABLE_SPLITTER.
              trimResults().split(permission)) {
            KeyValue kv = new KeyValue(authorizable);
            DBModelAuthorizable a = DBModelAuthorizables.from(kv);
            if (a == null) {
              action = kv.getValue();
              continue;
            }

            switch (a.getAuthzType()) {
              case Server:
                server = a.getName();
                break;
              case Db:
                database = a.getName();
                break;
              case Table:
              case View:
                table = a.getName();
                break;
              case URI:
                uri = a.getName();
                break;
              default:
                break;
            }
          }
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.