@Test public void testListUsersForRole() throws OdpsException { List<User> list = sm.listUsersForRole("admin"); }
public List<User> listUsersForRole(String roleName) throws OdpsException { String resource = ResourceBuilder.buildRoleResource(project, roleName); Map<String, String> params = new HashMap<String, String>(); params.put("users", null); ListUsersResponse resp = client.request(ListUsersResponse.class, resource, "GET", params, null, null ); List<User> users = new ArrayList<User>(); for (UserModel model : resp.users) { User t = new User(model, project, client); users.add(t); } return users; }
SecurityManager { public List<User> listUsersForRole(String roleName) throws OdpsException { String resource = ResourceBuilder.buildRoleResource(project, roleName); Map<String, String> params = new HashMap<String, String>(); params.put("users", null); ListUsersResponse resp = client.request(ListUsersResponse.class, resource, "GET", params, null, null ); List<User> users = new ArrayList<User>(); for (UserModel model : resp.users) { User t = new User(model, project, client); users.add(t); } return users; } }
SecurityManager { public List<User> listUsersForRole(String roleName) throws OdpsException { String resource = ResourceBuilder.buildRoleResource(project, roleName); Map<String, String> params = new HashMap<String, String>(); params.put("users", null); ListUsersResponse resp = client.request(ListUsersResponse.class, resource, "GET", params, null, null ); List<User> users = new ArrayList<User>(); for (UserModel model : resp.users) { User t = new User(model, project, client); users.add(t); } return users; } SecurityManager(String project, RestClient client); }
SecurityManager { public List<User> listUsersForRole(String roleName) throws OdpsException { String resource = ResourceBuilder.buildRoleResource(project, roleName); Map<String, String> params = new HashMap<String, String>(); params.put("users", null); ListUsersResponse resp = client.request(ListUsersResponse.class, resource, "GET", params, null, null ); List<User> users = new ArrayList<User>(); for (UserModel model : resp.users) { User t = new User(model, project, client); users.add(t); } return users; } 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 List<User> listUsersForRole(String roleName) throws OdpsException { String resource = ResourceBuilder.buildRoleResource(project, roleName); Map<String, String> params = new HashMap<String, String>(); params.put("users", null); ListUsersResponse resp = client.request(ListUsersResponse.class, resource, "GET", params, null, null ); List<User> users = new ArrayList<User>(); for (UserModel model : resp.users) { User t = new User(model, project, client); users.add(t); } return users; } 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);  }