public static RoleBean hideSensitiveDataFromRoleBean(ISecurityContext securityContext, RoleBean roleBean) {
        if (securityContext.isAdmin()) {
            return roleBean;
        } else {
            RoleBean role = new RoleBean();
            role.setId(roleBean.getId());
            role.setName(roleBean.getName());
            role.setPermissions(roleBean.getPermissions());
            role.setAutoGrant(roleBean.getAutoGrant());
            role.setDescription(roleBean.getDescription());
            // check if the role was created by the current user
            if (securityContext.getCurrentUser().equals(roleBean.getCreatedBy())) {
                role.setCreatedBy(roleBean.getCreatedBy());
                role.setCreatedOn(roleBean.getCreatedOn());
            }
            return role;
        }
    }
This method will hide sensitive data, such as created by, from the result

@param securityContext the security context
@param roleBean        the role
@return the role without sensitive data
manager/api/rest-impl/src/main/java/io/apiman/manager/api/rest/impl/util/RestHelper.java