view flys-client/src/main/java/de/intevation/flys/client/server/auth/DefaultUser.java @ 4284:7a94d5e7fc3d

Write the "hidden" attribute of a style into the collection's attribute when using the theme editor. Otherwise, the next time using the theme editor, the hidden attributes that should not be changed by the user are visible.
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Mon, 29 Oct 2012 07:18:42 +0100
parents 1387cdeb8d93
children
line wrap: on
line source
package de.intevation.flys.client.server.auth;

import java.util.List;

public class DefaultUser
implements   User
{
    protected String  name;
    protected String  account;
    protected String  password;
    protected boolean expired;
    protected List<String> roles;
    protected List<String> features;

    public DefaultUser() {
    }

    public DefaultUser(
        String       name,
        String       password,
        boolean      expired,
        List<String> roles,
        List<String> features
    ) {
        this.name     = name;
        this.password = password;
        this.expired  = expired;
        this.roles    = roles;
        this.features = features;
        this.account  = name;
    }

    @Override
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Override
    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    @Override
    public boolean hasExpired() {
        return expired;
    }

    public void setExpired(boolean expired) {
        this.expired = expired;
    }

    @Override
    public List<String> getRoles() {
        // XXX: return clone of the list?
        return this.roles;
    }

    public void setRoles(List<String> roles) {
        this.roles = roles;
    }

    @Override
    public boolean canUseFeature(String feature) {
        return this.features.contains(feature);
    }

    public void setAllowedFeatures(List<String> features) {
        this.features = features;
    }

    @Override
    public String getAccount() {
        return this.account;
    }

    public void setAccount(String account) {
        this.account = account;
    }
}
// vim:set ts=4 sw=4 si et fenc=utf8 tw=80:

http://dive4elements.wald.intevation.org