package org.nakedobjects.object.security;

import org.nakedobjects.object.reflect.MemberIdentifier;

public interface AuthorisationManager {

    boolean isUsable(Session session, MemberIdentifier identifier);

    boolean isVisible(Session session, MemberIdentifier identifier);

}


/*
Naked Objects - a framework that exposes behaviourally complete
business objects directly to the user.
Copyright (C) 2000 - 2004  Naked Objects Group Ltd

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program 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 General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

The authors can be contacted via www.nakedobjects.org (the
registered address of Naked Objects Group is Kingsway House, 123 Goldworth
Road, Woking GU21 1NR, UK).
*/
@@ -64,151 +64,1111 @@
 cts.
-object.reflect.MemberIdentifier;%0A%0Apublic interface AuthorisationManager %7B%0A%0A    boolean isUsable(Session session, MemberIdentifier identifier);%0A
+NakedObjectsComponent;%0Aimport org.nakedobjects.object.reflect.MemberIdentifier;%0A%0A%0A/**%0A * Authorises the user in the current session view and use members of an object.%0A */%0Apublic interface AuthorisationManager extends NakedObjectsComponent %7B%0A%0A    /**%0A     * Returns true when the user respresented by the specified session is authorised to use the member of the%0A     * class/object represented by the menber identifier.%0A     * %0A     * %3Cp%3E%0A     * Normally a user is authorised to access a particular member, whcih means they can see it, hence we rely%0A     * on the isVisible() method. However, sometimes we want leave thing visible, but just allow them to be%0A     * used. It is in these situations that this method is used.%0A     */%0A    boolean isUsable(Session session, MemberIdentifier identifier);%0A%0A    /**%0A     * Returns true when the user respresented by the specified session is authorised to view the member of%0A     * the class/object represented by the menber identifier. Normally the view of the specified field, or the%0A     * display of the action will be supressed if this returns false.%0A     */
 %0A   
@@ -1241,12 +1241,14 @@
 %0A%7D%0A%0A
-%0A
 /*%0A
+ * 
 Nake
@@ -1306,17 +1306,17 @@
 complete
-%0A
+ 
 business
@@ -1346,16 +1346,19 @@
 e user.%0A
+ * 
 Copyrigh
@@ -1375,17 +1375,16 @@
  - 2004 
- 
 Naked Ob
@@ -1399,17 +1399,23 @@
 oup Ltd%0A
-%0A
+ * %0A * 
 This pro
@@ -1474,17 +1474,17 @@
 r modify
-%0A
+ 
 it under
@@ -1504,32 +1504,35 @@
  the GNU General
+%0A *
  Public License 
@@ -1546,17 +1546,17 @@
 ished by
-%0A
+ 
 the Free
@@ -1616,17 +1616,17 @@
 , or
-%0A
+ 
 (at your
  opt
@@ -1621,16 +1621,19 @@
 (at your
+%0A *
  option)
@@ -1652,17 +1652,23 @@
 ersion.%0A
-%0A
+ * %0A * 
 This pro
@@ -1722,17 +1722,17 @@
  useful,
-%0A
+ 
 but WITH
@@ -1765,16 +1765,19 @@
 even the
+%0A *
  implied
@@ -1788,17 +1788,17 @@
 ranty of
-%0A
+ 
 MERCHANT
@@ -1845,17 +1845,16 @@
 OSE.
- 
  See the
 %0AGNU
@@ -1849,17 +1849,17 @@
  See the
-%0A
+ 
 GNU Gene
@@ -1876,16 +1876,19 @@
  License
+%0A *
  for mor
@@ -1898,17 +1898,23 @@
 etails.%0A
-%0A
+ * %0A * 
 You shou
@@ -1970,17 +1970,17 @@
  License
-%0A
+ 
 along wi
@@ -2012,16 +2012,19 @@
 write to
+%0A *
  the Fre
@@ -2033,17 +2033,17 @@
 Software
-%0A
+ 
 Foundati
@@ -2091,17 +2091,16 @@
 ton, MA 
- 
 02111-13
@@ -2106,14 +2106,19 @@
 307 
- 
 USA%0A
-%0A
+ * %0A * 
 The 
@@ -2171,17 +2171,17 @@
 org (the
-%0A
+ 
 register
@@ -2216,16 +2216,19 @@
 Group is
+%0A *
  Kingswa
@@ -2249,17 +2249,17 @@
 oldworth
-%0A
+ 
 Road, Wo
@@ -2278,10 +2278,11 @@
 R, UK).%0A
+ 
 */

Made the authorisation manager a NO component.