001/*
002 * Copyright (c) 2006-2014 Nuxeo SA (http://nuxeo.com/) and others.
003 *
004 * All rights reserved. This program and the accompanying materials
005 * are made available under the terms of the Eclipse Public License v1.0
006 * which accompanies this distribution, and is available at
007 * http://www.eclipse.org/legal/epl-v10.html
008 *
009 * Contributors:
010 *     Bogdan Stefanescu
011 *     Florent Guillaume
012 */
013package org.nuxeo.ecm.core.api.security;
014
015import java.io.Serializable;
016import java.util.Set;
017
018/**
019 * A user name, and a set of permissions granted/denied.
020 */
021public interface UserEntry extends Serializable {
022
023    String getUserName();
024
025    Set<String> getGrantedPermissions();
026
027    Set<String> getDeniedPermissions();
028
029    /**
030     * Adds a granted permission for this username.
031     *
032     * @since 5.9.4
033     * @param permission the permission
034     */
035    void addPrivilege(String permission);
036
037    /**
038     * Adds a permission for this username.
039     *
040     * @since 5.9.4
041     * @param permission the permission
042     * @param granted whether the permission is granted or denied
043     */
044    void addPrivilege(String permission, boolean granted);
045
046    /**
047     * Adds a permission for this username.
048     *
049     * @deprecated since 5.9.4 readonly is not used
050     */
051    @Deprecated
052    void addPrivilege(String permission, boolean granted, boolean readOnly);
053
054}