Support

Account

Forum Replies Created

  • In case anyone needs it, this is working for my needs:

    $get_current_screen = get_current_screen();
    $get_current_post_type = $get_current_screen->post_type;
    $my_option = get_field(‘my-option’,’option’);

  • public class RolesAccess implements Serializable {

    public String getUserPrincipalName() {
    FacesContext context = FacesContext.getCurrentInstance();
    Principal principal = context.getExternalContext().getUserPrincipal();
    if(principal == null) {
    return null;
    }
    return principal.getName();
    }

    public String getUser() {
    FacesContext context = FacesContext.getCurrentInstance();
    return context.getExternalContext().getRemoteUser();
    }

    public boolean isManager() {
    FacesContext context = FacesContext.getCurrentInstance();
    return context.getExternalContext().isUserInRole(“manager”);
    }

    }

Viewing 2 posts - 1 through 2 (of 2 total)