0 Replies Latest reply on Aug 15, 2007 7:46 AM by Miloslav Vlach

    Drools

    Miloslav Vlach Novice

      Can somebody translate this rule to the english ?

      rule InsertMemberBlog
       no-loop
       activation-group "permissions"
      when
       check: PermissionCheck(name == "memberBlog", action == "insert", granted == false)
       Principal(principalName : name)
       MemberBlog(member : member -> (member.getUsername().equals(principalName)))
      then
       check.grant();
      end;
      


      I would like to create rule which test if the user own the request:

      request.solver.loginName == principal

      But I don't know how to do in drools. There is my not working rule:
      rule solvRejectAssignment
      when
       c: PermissionCheck(name == "request", action=="solvRejectAssignment")
       Role(name == "IMS_SOLVER")
       r:Request(state == RequestState.ASSIGNED)
       p:Principal()
       eval( p.equals(r.solver.loginName))
      then
       System.out.println(p);
       c.grant();
      end;