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

org.nakedobjects.metamodel.authentication.AuthenticationSessionUtils Maven / Gradle / Ivy

The newest version!
package org.nakedobjects.metamodel.authentication;

import java.util.ArrayList;
import java.util.List;

import org.nakedobjects.applib.security.RoleMemento;
import org.nakedobjects.applib.security.UserMemento;


public final class AuthenticationSessionUtils {

    private AuthenticationSessionUtils() {}

    public static UserMemento createUserMemento(final AuthenticationSession session) {
        final List roles = new ArrayList();
        for (String roleName : session.getRoles()) {
			roles.add(new RoleMemento(roleName));
        }
        return new UserMemento(session.getUserName(), roles);
    }
}

// Copyright (c) Naked Objects Group Ltd.




© 2015 - 2024 Weber Informatics LLC | Privacy Policy