@Test public void testGetRolePolicy() throws OdpsException { String result = sm.getRolePolicy("admin"); Assert.assertNotNull(result); }
public String getRolePolicy(String roleName) throws OdpsException { String resource = ResourceBuilder.buildRoleResource(project, roleName); Map<String, String> params = new HashMap<String, String>(); params.put("policy", null); Response response = client.request(resource, "GET", params, null, null ); try { return new String(response.getBody(), "UTF-8"); } catch (UnsupportedEncodingException e) { throw new OdpsException("Can't parse response!", e); } }
SecurityManager { public String getRolePolicy(String roleName) throws OdpsException { String resource = ResourceBuilder.buildRoleResource(project, roleName); Map<String, String> params = new HashMap<String, String>(); params.put("policy", null); Response response = client.request(resource, "GET", params, null, null ); try { return new String(response.getBody(), "UTF-8"); } catch (UnsupportedEncodingException e) { throw new OdpsException("Can't parse response!", e); } } }
SecurityManager { public String getRolePolicy(String roleName) throws OdpsException { String resource = ResourceBuilder.buildRoleResource(project, roleName); Map<String, String> params = new HashMap<String, String>(); params.put("policy", null); Response response = client.request(resource, "GET", params, null, null ); try { return new String(response.getBody(), "UTF-8"); } catch (UnsupportedEncodingException e) { throw new OdpsException("Can't parse response!", e); } } SecurityManager(String project, RestClient client); }
SecurityManager { public String getRolePolicy(String roleName) throws OdpsException { String resource = ResourceBuilder.buildRoleResource(project, roleName); Map<String, String> params = new HashMap<String, String>(); params.put("policy", null); Response response = client.request(resource, "GET", params, null, null ); try { return new String(response.getBody(), "UTF-8"); } catch (UnsupportedEncodingException e) { throw new OdpsException("Can't parse response!", e); } } SecurityManager(String project, RestClient client); SecurityConfiguration getSecurityConfiguration(); SecurityConfiguration getSecurityConfiguration(boolean strip); void setSecurityConfiguration(
      SecurityConfiguration securityConfigration
  ); void setSecurityConfiguration(
      SecurityConfiguration securityConfigration, String supervisionToken
  ); String getProjectPolicy(); void putProjectPolicy(String policy); String getSecurityPolicy(); void putSecurityPolicy(String securityPolicy); String getRolePolicy(String roleName); void putRolePolicy(String roleName, String policy); List<User> listUsers(); List<Role> listRoles(); @Deprecated List<Role> listRolesForUser(String uid); List<Role> listRolesForUserID(String uid); List<Role> listRolesForUserName(String userName); List<User> listUsersForRole(String roleName); CheckPermissionResultInfo checkPermission(PermissionDesc desc); @Deprecated CheckPermissionResult checkPermission(
      ObjectType type, String objectName,
      ActionType action, String projectName,
      List<String> columns
  ); @Deprecated CheckPermissionResult checkPermission(
      ObjectType type, String objectName,
      ActionType action, List<String> columns
  ); @Deprecated CheckPermissionResult checkPermission(
      ObjectType type, String objectName,
      ActionType action
  ); @Deprecated CheckPermissionResult checkPermission(
      ObjectType type, String objectName,
      ActionType action, String projectName
  ); AuthorizationQueryInstance run(String query, Boolean jsonOutput); AuthorizationQueryInstance run(String query, Boolean jsonOutput, String supervisionToken); String runQuery(String query, Boolean jsonOutput); String runQuery(String query, Boolean jsonOutput, String supervisionToken); String generateAuthorizationToken(String policy, String type); }
SecurityManager { public String getRolePolicy(String roleName) throws OdpsException { String resource = ResourceBuilder.buildRoleResource(project, roleName); Map<String, String> params = new HashMap<String, String>(); params.put("policy", null); Response response = client.request(resource, "GET", params, null, null ); try { return new String(response.getBody(), "UTF-8"); } catch (UnsupportedEncodingException e) { throw new OdpsException("Can't parse response!", e); } } SecurityManager(String project, RestClient client); SecurityConfiguration getSecurityConfiguration(); SecurityConfiguration getSecurityConfiguration(boolean strip); void setSecurityConfiguration(
      SecurityConfiguration securityConfigration
  ); void setSecurityConfiguration(
      SecurityConfiguration securityConfigration, String supervisionToken
  ); String getProjectPolicy(); void putProjectPolicy(String policy); String getSecurityPolicy(); void putSecurityPolicy(String securityPolicy); String getRolePolicy(String roleName); void putRolePolicy(String roleName, String policy); List<User> listUsers(); List<Role> listRoles(); @Deprecated List<Role> listRolesForUser(String uid); List<Role> listRolesForUserID(String uid); List<Role> listRolesForUserName(String userName); List<User> listUsersForRole(String roleName); CheckPermissionResultInfo checkPermission(PermissionDesc desc); @Deprecated CheckPermissionResult checkPermission(
      ObjectType type, String objectName,
      ActionType action, String projectName,
      List<String> columns
  ); @Deprecated CheckPermissionResult checkPermission(
      ObjectType type, String objectName,
      ActionType action, List<String> columns
  ); @Deprecated CheckPermissionResult checkPermission(
      ObjectType type, String objectName,
      ActionType action
  ); @Deprecated CheckPermissionResult checkPermission(
      ObjectType type, String objectName,
      ActionType action, String projectName
  ); AuthorizationQueryInstance run(String query, Boolean jsonOutput); AuthorizationQueryInstance run(String query, Boolean jsonOutput, String supervisionToken); String runQuery(String query, Boolean jsonOutput); String runQuery(String query, Boolean jsonOutput, String supervisionToken); String generateAuthorizationToken(String policy, String type);  }