1   /*
2    * Apache License
3    * Version 2.0, January 2004
4    * http://www.apache.org/licenses/
5    *
6    * Copyright 2008 by chenillekit.org
7    *
8    * Licensed under the Apache License, Version 2.0 (the "License");
9    * you may not use this file except in compliance with the License.
10   * You may obtain a copy of the License at
11   *
12   * http://www.apache.org/licenses/LICENSE-2.0
13   */
14  
15  /**
16   *
17   */
18  
19  package org.chenillekit.access.utils;
20  
21  import org.chenillekit.access.WebSessionUser;
22  
23  /**
24   * JavaBean used to store infos about the user currently logged
25   * in. Typically the final user want to extend this one.
26   *
27   * @version $Id: DummyUser.java 380 2008-12-30 10:21:52Z mlusetti $
28   */
29  
30  public class DummyUser implements WebSessionUser
31  {
32  //	private int userId;
33  //	private String name;
34  
35  	// Both used for security constraints
36  	private int roles;
37  	private String[] groups;
38  
39  	public DummyUser(int roleWeigth)
40  	{
41  //		this.userId = 2;
42  //		this.name = "dummy";
43  		this.roles = 0;
44  		this.groups = new String[]{"dummy"};
45  	}
46  
47  //	public int getUserId()
48  //	{
49  //		return userId;
50  //	}
51  
52  //	public String getName()
53  //	{
54  //		return name;
55  //	}
56  
57  	/**
58  	 * get the role ids.
59  	 *
60  	 * @return role ids
61  	 */
62  	public int getRoleWeight()
63  	{
64  		return roles;
65  	}
66  
67  	/**
68  	 * get the group names.
69  	 *
70  	 * @return group names
71  	 */
72  	public String[] getGroups()
73  	{
74  		return groups;
75  	}
76  }