/*********************************************************************/ /* */ /* AgentService Framework */ /* www.agentservice.it */ /* */ /* Copyright (C) 2007 l.i.d.o. - DIST, University of Genoa, Italy */ /* GNU Lesser General Public License */ /* */ /* This library is free software; you can redistribute it and/or */ /* modify it under the terms of the GNU Lesser General Public */ /* License as published by the Free Software Foundation, */ /* version 2.1 of the License. */ /* */ /* This library is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU */ /* Lesser General Public License for more details. */ /* */ /* You should have received a copy of the GNU Lesser General Public */ /* License along with this library; if not, write to the */ /* Free Software Foundation, Inc., 59 Temple Place - Suite 330, */ /* Boston, MA 02111-1307, USA. */ /* */ /*********************************************************************/ using System; namespace AgentService.Interop { /// /// Enumeration UserGroup. Enumerates the /// different classes that an user can /// balong to. /// public enum UserGroup { /// /// A simple user with no privilegies. /// Anonymous users can only browse the /// platform and cannot issued any command /// to the platform, neither browse sensible /// data. /// Anonymous, /// /// A registered user. Registered users can /// interact with the AMS in order to stop, /// create and modify the state of the agents /// that belong to him. /// User, /// /// Administrator. Platform administrators /// have a complete access to the platform /// services and manage it. /// Administrator } /// /// Class User. Defines the user's /// credentials of a user of an /// instance of the AgentService /// platform. /// [Serializable] public class User { /// /// user name /// private string name; /// /// Gets the user name. /// public string Name { get { return this.name; } } /// /// user password /// private string password; /// /// Gets the user password. /// public string Password { get { return this.password; } } /// /// user group /// private UserGroup group; /// /// Gets the group the user /// belongs to. /// public UserGroup Group { get { return this.group; } } /// /// Constructs an anonymous User object /// /// user name /// user password public User() { this.group = UserGroup.Anonymous; this.name = string.Empty; this.password = null; } /// /// Constructs an anonymous User object /// /// user name /// user password /// user group public User(string name, string password, UserGroup group) { this.name = name; this.password = password; this.group = group; } } }