Update of 
/var/cvs/contributions/didactor2/src/education/java/nl/didactor/component/education
In directory james.mmbase.org:/tmp/cvs-serv27522

Modified Files:
        DidactorEducation.java 
Log Message:
renamed 'actions' to something which actually sounds like an action


See also: 
http://cvs.mmbase.org/viewcvs/contributions/didactor2/src/education/java/nl/didactor/component/education


Index: DidactorEducation.java
===================================================================
RCS file: 
/var/cvs/contributions/didactor2/src/education/java/nl/didactor/component/education/DidactorEducation.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -b -r1.9 -r1.10
--- DidactorEducation.java      21 Jan 2008 14:45:32 -0000      1.9
+++ DidactorEducation.java      21 Jan 2008 16:13:03 -0000      1.10
@@ -15,7 +15,7 @@
 
 /**
  * @javadoc
- * @version $Id: DidactorEducation.java,v 1.9 2008/01/21 14:45:32 michiel Exp $
+ * @version $Id: DidactorEducation.java,v 1.10 2008/01/21 16:13:03 michiel Exp 
$
  */
 public class DidactorEducation extends Component {
     private static Logger log = 
Logging.getLoggerInstance(DidactorEducation.class);
@@ -62,13 +62,12 @@
     public boolean[] may (String operation, Cloud cloud, Map context, String[] 
arguments) {
         boolean mayvalue[]= new boolean[] {false, false};
         try {
-            if (operation.equals( "isSelfOrTeacherOf") || operation.equals( 
"isTeacherOf")) {
-
+            if (operation.equals("viewAnswers") || operation.equals("rate")) {
                 Object user = context.get( "user");
-                Object educationobj= context.get( "education");
-                Object classobj= context.get( "class");
+                Object educationobj = context.get( "education");
+                Object classobj     = context.get( "class");
 
-                MMObjectNode usernode = 
MMBase.getMMBase().getBuilder("people").getNode(  ((Integer)user).intValue());
+                MMObjectNode usernode = 
MMBase.getMMBase().getBuilder("people").getNode(((Integer)user).intValue());
                 if (usernode == null) {
                     throw new JspTagException("User with number '" + user + "' 
not found");
                 }
@@ -88,17 +87,18 @@
                 int subjectno = 0;
 
                 if ((arguments.length > 0) && (arguments[0] != null)) {
-                    subjectno= castIdentifier( context.get( arguments[0]));
+                    subjectno = castIdentifier(context.get( arguments[0]));
                 } else {
                     throw new JspTagException("1 argument required: subject 
person ID");
                 }
                 //System.out.println( subjectno);
                 //System.out.println( usernode.getNumber());
 
-                boolean isTeacherOf= ClassRoom.isClassMember(usernode, 
subjectno, classno, educationno, "teacher", cloud)
+                boolean isTeacherOf=
+                    ClassRoom.isClassMember(usernode, subjectno, classno, 
educationno, "teacher", cloud)
                 || ClassRoom.isWorkgroupMember(usernode, subjectno, classno, 
educationno, "teacher", cloud);
 
-                if (operation.equals( "isTeacherOf")) {
+                if (operation.equals("rate")) {
                     mayvalue[0]= isTeacherOf;
                 } else {
                     mayvalue[0]= (subjectno == usernode.getNumber()) || 
isTeacherOf;
_______________________________________________
Cvs mailing list
[email protected]
http://lists.mmbase.org/mailman/listinfo/cvs

Reply via email to