view flys-client/src/main/java/de/intevation/flys/client/server/auth/was/User.java @ 3485:71ba3cf3ec5e

Refactor Authentication to allow to pass the Freatures to the user class The Features class can be used to receive the allowed features for the users roles. flys-client/trunk@5183 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Bjoern Ricks <bjoern.ricks@intevation.de>
date Fri, 10 Aug 2012 07:06:18 +0000
parents 98514ab2c9ba
children 23095983c249
line wrap: on
line source
package de.intevation.flys.client.server.auth.was;

import java.util.Date;
import java.util.List;

import de.intevation.flys.client.server.auth.DefaultUser;

public class User
extends DefaultUser
implements de.intevation.flys.client.server.auth.User {

    private Assertion assertion;

    public User(String name, String password, List<String> roles, Assertion assertion) {
        this.setName(name);
        this.setPassword(password);
        this.setRoles(roles);
        this.assertion = assertion;
    }

    @Override
    public boolean hasExpired() {
        Date until = this.assertion.getUntil();
        if (until != null) {
            Date current = new Date();
            return !current.after(until);
        }
        return false;
    }
}

// vim:set ts=4 sw=4 si et fenc=utf8 tw=80:

http://dive4elements.wald.intevation.org