public static Result createRole(String name){
String inheritedRole=DefaultRoles.REGISTERED_USER.toString();
String description="";
JsonNode json = request().body().asJson();
if(json != null) {
description = Objects.firstNonNull(json.findPath("description").textValue(),"");
}
try {
RoleService.createRole(name, inheritedRole, description);
} catch (RoleNotFoundException e) {
return badRequest("Role " + inheritedRole + " does not exist. Hint: check the 'inheritedRole' in your payload");