All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.yahoo.elide.jsonapi.resources.SecurityContextUser Maven / Gradle / Ivy

The newest version!
/*
 * Copyright 2020, Yahoo Inc.
 * Licensed under the Apache License, Version 2.0
 * See LICENSE file in project root for terms.
 */

package com.yahoo.elide.jsonapi.resources;

import com.yahoo.elide.core.security.User;

import jakarta.ws.rs.core.SecurityContext;

/**
 * Elide User for JAXRS.
 */
public class SecurityContextUser extends User {
    private SecurityContext ctx;

    public SecurityContextUser(SecurityContext ctx) {
        super(ctx.getUserPrincipal());
        this.ctx = ctx;
    }

    @Override
    public boolean isInRole(String role) {
        return ctx.isUserInRole(role);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy