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

org.seedstack.seed.security.PrincipalCustomizer Maven / Gradle / Ivy

/**
 * Copyright (c) 2013-2016, The SeedStack authors 
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 */
package org.seedstack.seed.security;

import org.seedstack.seed.security.principals.PrincipalProvider;

import java.util.Collection;

/**
 * Interface used to add principals to the one added by a realm
 *
 * @param  the Realm type concerned
 * @author [email protected]
 */
public interface PrincipalCustomizer {

    /**
     * Specifies the realm class to apply
     *
     * @return The Class of the realm
     */
    Class supportedRealm();

    /**
     * Specifies the principals to add to the ones given by the realm. The
     * principals provided as parameters are read only.
     *
     * @param identity        the identity principal.
     * @param realmPrincipals the principals already given by the realm. Read only
     * @return the principals to add.
     */
    Collection> principalsToAdd(PrincipalProvider identity, Collection> realmPrincipals);
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy