Class UserRoleListResource
- java.lang.Object
-
- org.pentaho.platform.web.http.api.resources.AbstractJaxRSResource
-
- org.pentaho.platform.web.http.api.resources.UserRoleListResource
-
public class UserRoleListResource extends AbstractJaxRSResource
The UserRoleListResource service lists roles, permissions, and users. Provides a list of users per role and roles per user.
-
-
Field Summary
Fields Modifier and Type Field Description protected String
adminRole
protected static UserRoleListService
userRoleListService
-
Fields inherited from class org.pentaho.platform.web.http.api.resources.AbstractJaxRSResource
acceptableMediaTypes, httpServletRequest, httpServletResponse, TEXT_HTML
-
-
Constructor Summary
Constructors Constructor Description UserRoleListResource()
UserRoleListResource(ArrayList<String> systemRoles, String adminRole, String anonymousRole, ArrayList<String> extraRoles)
UserRoleListResource(ArrayList<String> systemRoles, String adminRole, ArrayList<String> extraRoles)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description RoleListWrapper
getAllRoles()
Get a list of the all roles in the platform including Anonymous and Administrator.RoleListWrapper
getExtraRoles()
Returns roles identified as "extra roles" from the repository.RoleListWrapper
getPermissionRoles()
Return a list of the permission roles in the platform.UserListWrapper
getPermissionUsers()
Returns the list of permission users in the platform.RoleListWrapper
getRoles(String addExtraRoles)
Get a list of the standard roles in the platform.RolesWrapper
getRolesForUser(String user)
Gets the roles for the given user.RoleListWrapper
getSystemRoles()
Returns Roles identified as "system roles" from the repository.UserListWrapper
getUsers()
Returns the list of users in the platform.UsersWrapper
getUsersInRole(String role)
Gets the list of users that have the role specified by the role parameter.-
Methods inherited from class org.pentaho.platform.web.http.api.resources.AbstractJaxRSResource
setHttpHeaders
-
-
-
-
Field Detail
-
adminRole
protected String adminRole
-
userRoleListService
protected static UserRoleListService userRoleListService
-
-
Method Detail
-
getPermissionUsers
public UserListWrapper getPermissionUsers() throws Exception
Returns the list of permission users in the platform.Example Request:
GET pentaho/api/userrolelist/permission-users- Returns:
- A list of User objects for users with permissions in the platform.
Example Response:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><userList><users>pat</users><users>admin</users><users>suzy</users><users>tiffany</users><users>enco*de:te^s_t$</users></userList>
- Throws:
Exception
-
getPermissionRoles
public RoleListWrapper getPermissionRoles() throws Exception
Return a list of the permission roles in the platform.Example Request:
GET pentaho/api/userrolelist/permission-roles- Returns:
- A list of permission roles in the platform.
Example Response:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><roleList><roles>Anonymous</roles><roles>Business Analyst</roles><roles>Authenticated</roles><roles>Report Author</roles><roles>Power User</roles></roleList>
- Throws:
Exception
-
getUsers
public UserListWrapper getUsers() throws Exception
Returns the list of users in the platform.Example Request:
GET pentaho/api/userrolelist/users- Returns:
- A list of User objects for users in the platform.
Example Response:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><userList><users>pat</users><users>admin</users><users>suzy</users><users>tiffany</users><users>enco*de:te^s_t$</users></userList>
- Throws:
Exception
-
getRoles
public RoleListWrapper getRoles(String addExtraRoles)
Get a list of the standard roles in the platform.Example Request:
GET pentaho/api/userrolelist/roles- Returns:
- A list of Role objects that contains the standard roles in the platform.
Example Response:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><roleList><roles>Anonymous</roles><roles>Business Analyst</roles><roles>Authenticated</roles><roles>Report Author</roles><roles>Power User</roles></roleList>
-
getAllRoles
public RoleListWrapper getAllRoles() throws Exception
Get a list of the all roles in the platform including Anonymous and Administrator.Example Request:
GET pentaho/api/userrolelist/allRoles- Returns:
- A list of Role objects that contains all the roles in the platform.
Example Response:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><roleList><roles>Anonymous</roles><roles>Business Analyst</roles><roles>Authenticated</roles><roles>Report Author</roles><roles>Power User</roles><roles>Authenticated</roles><roles>Anonymous</roles></roleList>
- Throws:
Exception
-
getSystemRoles
public RoleListWrapper getSystemRoles()
Returns Roles identified as "system roles" from the repository.Example Request:
GET pentaho/api/userrolelist/systemRoles- Returns:
- A list of system roles.
Example Response:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><roleList><roles>Authenticated</roles><roles>Administrator</roles><roles>Anonymous</roles></roleList>
-
getExtraRoles
public RoleListWrapper getExtraRoles()
Returns roles identified as "extra roles" from the repository.Example Request:
GET pentaho/api/userrolelist/extraRoles- Returns:
- Roles identified as "extra roles" are returned as a list from the repository as shown in the example.
Example Response:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><roleList><roles>Authenticated</roles><roles>Anonymous</roles></roleList>
-
getRolesForUser
public RolesWrapper getRolesForUser(String user) throws Exception
Gets the roles for the given user.Example Request:
GET pentaho/api/userrolelist/getRolesForUser?user=admin- Parameters:
user
- The username to get the roles for- Returns:
- A list of Role objects containing the roles for the given user.
Example Response:
<?xml version="1.0" encoding="UTF-8"?><roles><role>Administrator</role><role>Authenticated</role></roles>
- Throws:
Exception
-
getUsersInRole
public UsersWrapper getUsersInRole(String role) throws Exception
Gets the list of users that have the role specified by the role parameter. The list of valid roles can be obtained by calling the /roles endpoint.Example Request:
GET pentaho/api/userrolelist/getUsersInRole?role=Authenticated- Parameters:
role
- The role to get the users for- Returns:
- A list of User objects that have the roles specified in the role parameter.
Example Response:
<?xml version="1.0" encoding="UTF-8"?><users><user>pat</user><user>admin</user><user>suzy</user><user>tiffany</user><user>enco*de:te^s_t$</user></users>
- Throws:
Exception
-
-