[Building Sakai] Full JSP CRUD tool

menjuanpablo menjuanpablo at gmail.com
Mon May 11 07:24:30 PDT 2009


hi, 
the line 98 is in the fuction getallvisibleitems

> org.sakaiproject.otrotodo.logic.OtrotodoLogic#getAllVisibleItems(java.lang.String,
> java.lang.String)
>    */
>   public List<OtrotodoItem> getAllVisibleItems(String locationId, String
> userId) {
>      log.debug("Fetching visible items for " + userId + " in site: " +
> locationId);
>      List<OtrotodoItem> l = null;
>      if (locationId == null) {
>         // get all items
>         l = dao.findAll(OtrotodoItem.class);
>      } else {
>         l = dao.findBySearch(OtrotodoItem.class,
>               new Search("locationId", locationId) );
>      }
>      // check if the current user can see all items (or is super user)
>      if ( externalLogic.isUserAdmin(userId) ||
>            externalLogic.isUserAllowedInLocation(userId,
> ExternalLogic.ITEM_READ_HIDDEN, locationId) ) {
>         log.debug("Security override: " + userId + " able to view all
> items");
>      } else {
>         // go backwards through the loop to avoid hitting the "end" early
> >>>        for (int i=l.size()-1; i >= 0; i--)
> {<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
>            OtrotodoItem item = (OtrotodoItem) l.get(i);
>            if ( item.getHidden().booleanValue() &&
>                  !item.getOwnerId().equals(userId) ) {
>               l.remove(item);
>            }
>         }
>      }
>      return l;
>   }


-- 
View this message in context: http://www.nabble.com/Full-JSP-CRUD-tool-tp23437843p23484347.html
Sent from the Sakai - Development mailing list archive at Nabble.com.



More information about the sakai-dev mailing list