KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > ivata > groupware > admin > security > right > SecurityRights


1 /*
2  * Copyright (c) 2001 - 2005 ivata limited.
3  * All rights reserved.
4  * -----------------------------------------------------------------------------
5  * ivata groupware may be redistributed under the GNU General Public
6  * License as published by the Free Software Foundation;
7  * version 2 of the License.
8  *
9  * These programs are free software; you can redistribute them and/or
10  * modify them under the terms of the GNU General Public License
11  * as published by the Free Software Foundation; version 2 of the License.
12  *
13  * These programs are distributed in the hope that they will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
16  *
17  * See the GNU General Public License in the file LICENSE.txt for more
18  * details.
19  *
20  * If you would like a copy of the GNU General Public License write to
21  *
22  * Free Software Foundation, Inc.
23  * 59 Temple Place - Suite 330
24  * Boston, MA 02111-1307, USA.
25  *
26  *
27  * To arrange commercial support and licensing, contact ivata at
28  * http://www.ivata.com/contact.jsp
29  * -----------------------------------------------------------------------------
30  * $Log: SecurityRights.java,v $
31  * Revision 1.2 2005/04/09 17:19:04 colinmacleod
32  * Changed copyright text to GPL v2 explicitly.
33  *
34  * Revision 1.1.1.1 2005/03/10 17:50:44 colinmacleod
35  * Restructured ivata op around Hibernate/PicoContainer.
36  * Renamed ivata groupware.
37  *
38  * Revision 1.2 2004/11/12 15:56:45 colinmacleod
39  * Removed dependencies on SSLEXT.
40  * Moved Persistence classes to ivata masks.
41  *
42  * Revision 1.1 2004/07/13 19:41:11 colinmacleod
43  * Moved project to POJOs from EJBs.
44  * Applied PicoContainer to services layer (replacing session EJBs).
45  * Applied Hibernate to persistence layer (replacing entity EJBs).
46  * -----------------------------------------------------------------------------
47  */

48 package com.ivata.groupware.admin.security.right;
49
50 import com.ivata.groupware.admin.security.server.SecuritySession;
51 import com.ivata.mask.util.SystemException;
52
53 /**
54  * @author Colin MacLeod
55  * <a HREF='mailto:colin.macleod@ivata.com'>colin.macleod@ivata.com</a>
56  * @since Apr 18, 2004
57  * @version $Revision: 1.2 $
58  */

59 public interface SecurityRights {
60     /**
61      * <p>See if a user has sufficient rights to add user to the system - it's meen to everyOne group.</p>
62      *
63      * @param userName the user who wants to add another user.
64      * @param personId the unique identifier of the person who will be added.
65      * @return <code>true</code> if this action is authorized by the system,
66      * otherwise <code>false</code>.
67      *
68      * @ejb.interface-method
69      * view-type = "both"
70      */

71     public boolean canAddUser(SecuritySession securitySession)
72         throws SystemException;
73     /**
74      * <p>See if a user has sufficient rights to amend user in the
75      * system - it's meen in everyone group.</p>
76      *
77      * @param userName the user who wants to add another user.
78      * @param userNameAmend the user who should be amended.
79      * @return <code>true</code> if this action is authorized by the system,
80      * otherwise <code>false</code>.
81      *
82      * @ejb.interface-method
83      * view-type = "both"
84      */

85     public boolean canAmendUser(SecuritySession securitySession)
86         throws SystemException;
87     /**
88      * <p>See if a user has sufficient rights to remove user from the
89      * system - it's meen from everone group.</p>
90      *
91      * @param userName the user who wants to add another user.
92      * @param userNameRemove the user who should be removed.
93      * @return <code>true</code> if this action is authorized by the system,
94      * otherwise <code>false</code>.
95      *
96      * @ejb.interface-method
97      * view-type = "both"
98      */

99     public boolean canRemoveUser(SecuritySession securitySession)
100         throws SystemException;
101     /**
102      * <p>Internal helper method. Find out if a user is allowed to access
103      * entries in a given group.</p>
104      *
105      * @param userName the name of the user to check the user rights for.
106      * @param groupId the unique identifier of the group to check.
107      * @param access the access level as defined in {@link
108      * com.ivata.groupware.security.person.group.right.RightConstants
109      * RightConstants}.
110      * @return <code>true</code> if the user is entitled to access entries in the
111      * group, otherwise <code>false</code>.
112      */

113     public boolean canUser(
114         SecuritySession securitySession,
115         Integer JavaDoc access)
116         throws SystemException;
117 }
Popular Tags