Role

public class Role

This class helps the application to check the authority of the user over a request resource.

Fields

log

static final Logger log

Methods

isClientAuthorized

public static boolean isClientAuthorized(HttpRequest request, String grp, String name)

Check if the user request a URL has permission

Parameters:
  • request – The request object that the action handler receives
  • grp – The permission group name
  • name – The permission name
Returns:

True if the user has the permission else False

isUserAdmin

public static boolean isUserAdmin(String userEmail)

Check if the requesting user is an admin

Parameters:
  • userEmail – The email id of the user requesting a URL
Returns:

True if the user is admin else False

isUserAdmin

public static boolean isUserAdmin(HttpRequest request)

Check if the requesting user is an admin

Parameters:
  • request – The request object that the action handler receives
Returns:

True if the user is admin else False