Changeset 331
- Timestamp:
- 04/05/06 10:16:45
- Files:
-
- trunk/calendar3/access/src/edu/rpi/cct/uwcal/access/Ace.java (modified) (2 diffs)
- trunk/calendar3/access/src/edu/rpi/cct/uwcal/access/Acl.java (modified) (4 diffs)
- trunk/calendar3/access/src/edu/rpi/cct/uwcal/access/Privilege.java (modified) (1 diff)
- trunk/calendar3/access/src/edu/rpi/cct/uwcal/access/Privileges.java (modified) (1 diff)
- trunk/calendar3/appcommon/src/org/bedework/appcommon/AccessAppUtil.java (modified) (4 diffs)
- trunk/calendar3/appcommon/src/org/bedework/appcommon/EventFormatter.java (modified) (1 diff)
- trunk/calendar3/calCore/src/org/bedework/calcore/hibernate/AccessUtil.java (modified) (5 diffs)
- trunk/calendar3/calCore/src/org/bedework/calcore/hibernate/Calendars.java (modified) (7 diffs)
- trunk/calendar3/calCore/src/org/bedework/calcore/hibernate/CalintfImpl.java (modified) (3 diffs)
- trunk/calendar3/calCore/src/org/bedework/calcore/hibernate/HibSession.java (modified) (1 diff)
- trunk/calendar3/calFacade/src/org/bedework/calfacade/base/CalintfBase.java (modified) (2 diffs)
- trunk/calendar3/calFacade/src/org/bedework/calfacade/ifs/Calintf.java (modified) (2 diffs)
- trunk/calendar3/calFacade/src/org/bedework/calfacade/ifs/EventsI.java (modified) (1 diff)
- trunk/calendar3/caldav/src/edu/rpi/cct/uwcal/caldav/CaldavBWIntf.java (modified) (3 diffs)
- trunk/calendar3/caldav/src/edu/rpi/cct/uwcal/caldav/CaldavComponentNode.java (modified) (9 diffs)
- trunk/calendar3/calsvc/src/org/bedework/calsvc/CalSvc.java (modified) (3 diffs)
- trunk/calendar3/calsvci/src/org/bedework/calsvci/CalSvcI.java (modified) (4 diffs)
- trunk/calendar3/lib/tlds/bedework.tld (modified) (2 diffs)
- trunk/calendar3/webclient/war/docs/calendar/emitCalendar.jsp (modified) (1 diff)
- trunk/calendar3/webcommon/src/org/bedework/webcommon/BwAbstractAction.java (modified) (3 diffs)
- trunk/calendar3/webcommon/src/org/bedework/webcommon/taglib/EmitAclTag.java (added)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/calendar3/access/src/edu/rpi/cct/uwcal/access/Ace.java
r314 r331 343 343 } 344 344 345 /** Return an ace which matches the name and whoType. 346 * 347 * @param acl 348 * @param name 349 * @param whoType 350 * @return Ace if we find a match else null 351 * @throws AccessException 352 */ 353 public static Ace find(Acl acl, 354 String name, int whoType) throws AccessException { 355 Iterator it = acl.getAces().iterator(); 356 357 while (it.hasNext()) { 358 Ace ace = (Ace)it.next(); 359 360 if ((whoType == ace.getWhoType()) && 361 ((whoType == whoTypeUnauthenticated) || 362 (whoType == whoTypeOwner) || 363 ace.whoMatch(name))) { 364 return ace; 365 } 366 } 367 368 return null; 369 } 370 345 371 /* ==================================================================== 346 372 * Decoding methods … … 368 394 * group but what's the inverted meaning? 369 395 * 370 * <p>If .getPrivileges is true the Collection of privilege objects396 * <p>If getPrivileges is true the Collection of privilege objects 371 397 * defining the ace will be returned. This is needed for acl 372 398 * manipulation rather than evaluation. trunk/calendar3/access/src/edu/rpi/cct/uwcal/access/Acl.java
r320 r331 88 88 89 89 /** Used while evaluating access */ 90 private Ace ace = new Ace();90 // private Ace ace = new Ace(); 91 91 92 92 /** Constructor … … 123 123 */ 124 124 public static class CurrentAccess { 125 /** The Acl used to evaluate the access. We should not necessarily 126 * make this available to the client. 127 */ 128 public Acl acl; 129 125 130 /** Allowed access for each privilege type 126 131 * @see PrivilegeDefs … … 177 182 CurrentAccess ca = new CurrentAccess(); 178 183 ca.desiredAccess = how; 179 184 ca.acl = this; 185 186 /* 180 187 setEncoded(acl); 181 188 … … 259 266 } 260 267 } // getPrivileges 268 */ 269 decode(acl); 270 271 if (authenticated) { 272 isOwner = who.getAccount().equals(owner); 273 } 274 275 StringBuffer debugsb = null; 276 277 if (debug) { 278 debugsb = new StringBuffer("Check access for '"); 279 debugsb.append(new String(acl)); 280 debugsb.append("' with authenticated = "); 281 debugsb.append(authenticated); 282 debugsb.append(" isOwner = "); 283 debugsb.append(isOwner); 284 } 285 286 Ace ace; 287 288 getPrivileges: { 289 if (!authenticated) { 290 ace = Ace.find(this, null, Ace.whoTypeUnauthenticated); 291 if (ace != null) { 292 ca.privileges = ace.getHow(); 293 } 294 295 break getPrivileges; 296 } 297 298 if (isOwner) { 299 ace = Ace.find(this, null, Ace.whoTypeOwner); 300 if (ace != null) { 301 ca.privileges = ace.getHow(); 302 } else { 303 ca.privileges = defaultOwnerPrivileges; 304 } 305 306 break getPrivileges; 307 } 308 309 // Not owner - look for user 310 ace = Ace.find(this, who.getAccount(), Ace.whoTypeUser); 311 if (ace != null) { 312 ca.privileges = ace.getHow(); 313 if (debug) { 314 debugsb.append("... For user got: " + new String(ca.privileges)); 315 } 316 317 break getPrivileges; 318 } 319 320 // No specific user access - look for group access 321 322 if (who.getGroupNames() != null) { 323 Iterator it = who.getGroupNames().iterator(); 324 325 while (it.hasNext()) { 326 String group = (String)it.next(); 327 if (debug) { 328 debugsb.append("...Try access for group " + group); 329 } 330 ace = Ace.find(this, group, Ace.whoTypeGroup); 331 if (ace != null) { 332 ca.privileges = mergePrivileges(ca.privileges, ace.getHow()); 333 } 334 } 335 } 336 337 if (ca.privileges != null) { 338 if (debug) { 339 debugsb.append("...For groups got: " + new String(ca.privileges)); 340 } 341 342 break getPrivileges; 343 } 344 345 // "other" access set? 346 ace = Ace.find(this, null, Ace.whoTypeOther); 347 if (ace != null) { 348 ca.privileges = ace.getHow(); 349 350 if (debug) { 351 debugsb.append("...For other got: " + new String(ca.privileges)); 352 } 353 354 break getPrivileges; 355 } 356 } // getPrivileges 261 357 262 358 if (ca.privileges == null) { trunk/calendar3/access/src/edu/rpi/cct/uwcal/access/Privilege.java
r314 r331 105 105 } 106 106 107 /** Constructor for non-abstract non-denial 108 * 109 * @param name 110 * @param description 111 * @param index 112 */ 113 public Privilege(String name, 114 String description, 115 int index) { 116 this(name, description, false, false, index); 117 } 118 107 119 /** 108 120 * @param val trunk/calendar3/access/src/edu/rpi/cct/uwcal/access/Privileges.java
r314 r331 104 104 105 105 static { 106 privs[privAll] = new Privilege("all", "All privileges", false, false, 107 privAll); 108 109 privs[privRead] = new Privilege("read", "Read any calendar object", false, false, 110 privRead); 111 112 privs[privReadAcl] = new Privilege("read-acl", "Read calendar accls", false, false, 106 privs[privAll] = new Privilege("all", "All privileges", privAll); 107 108 privs[privRead] = new Privilege("read", "Read any calendar object", privRead); 109 110 privs[privReadAcl] = new Privilege("read-acl", "Read calendar accls", 113 111 privReadAcl); 114 112 115 113 privs[privReadCurrentUserPrivilegeSet] = 116 114 new Privilege("read-current-user-privilege-set", 117 "Read current user privilege set property", false, false,115 "Read current user privilege set property", 118 116 privReadCurrentUserPrivilegeSet); 119 117 120 118 privs[privReadFreeBusy] = new Privilege("view-free-busy", 121 119 "View a users free busy information", 122 false, false,privReadFreeBusy);123 124 privs[privWrite] = new Privilege("write", "Write any calendar object", false, false,120 privReadFreeBusy); 121 122 privs[privWrite] = new Privilege("write", "Write any calendar object", 125 123 privWrite); 126 124 127 privs[privWriteAcl] = new Privilege("write-acl", "Write ACL", false, false,128 privWriteAcl);129 130 privs[privWriteProperties] = new Privilege("write-properties", "Write calendar properties", false, false,125 privs[privWriteAcl] = new Privilege("write-acl", "Write ACL", privWriteAcl); 126 127 privs[privWriteProperties] = new Privilege("write-properties", 128 "Write calendar properties", 131 129 privWriteProperties); 132 130 133 privs[privWriteContent] = new Privilege("write-content", "Write calendar content", false, false, 131 privs[privWriteContent] = new Privilege("write-content", 132 "Write calendar content", 134 133 privWriteContent); 135 134 136 privs[privBind] = new Privilege("create", "Create a calendar object", false, false,135 privs[privBind] = new Privilege("create", "Create a calendar object", 137 136 privBind); 138 137 139 privs[privUnbind] = new Privilege("delete", "Delete a calendar object", false, false,138 privs[privUnbind] = new Privilege("delete", "Delete a calendar object", 140 139 privUnbind); 141 140 142 privs[privUnlock] = new Privilege("unlock", "Remove a lock", false, false,141 privs[privUnlock] = new Privilege("unlock", "Remove a lock", 143 142 privUnlock); 144 143 trunk/calendar3/appcommon/src/org/bedework/appcommon/AccessAppUtil.java
r320 r331 168 168 Ace ace = (Ace)it.next(); 169 169 170 emitAce(ace, true); 171 emitAce(ace, false); 170 boolean aceOpen = emitAce(ace, true, false); 171 if (emitAce(ace, false, aceOpen)) { 172 aceOpen = true; 173 } 174 175 if (aceOpen) { 176 xml.closeTag(WebdavTags.ace); 177 } 172 178 } 173 179 } … … 180 186 } 181 187 } 182 188 183 189 /** Produce an xml representation of supported privileges. This is the same 184 190 * at all points in the system and is identical to the webdav/caldav … … 279 285 } 280 286 281 private void emitAce(Ace ace, boolean denials) throws Throwable {287 private boolean emitAce(Ace ace, boolean denials, boolean aceOpen) throws Throwable { 282 288 Collection privs = ace.getPrivs(); 283 boolean emittedWho= false;289 boolean tagOpen = false; 284 290 285 291 QName tag; … … 295 301 296 302 if (denials == p.getDenial()) { 297 if (!emittedWho) { 303 if (!aceOpen) { 304 xml.openTag(WebdavTags.ace); 305 298 306 emitAceWho(ace); 299 emittedWho= true;307 aceOpen = true; 300 308 } 301 309 302 xml.openTag(tag); 310 if (!tagOpen) { 311 xml.openTag(tag); 312 tagOpen = true; 313 } 303 314 xml.emptyTag(privTags[p.getIndex()]); 304 xml.closeTag(tag);305 315 } 306 316 } 307 308 if (emittedWho) { 309 xml.closeTag(WebdavTags.ace); 310 } 317 318 if (tagOpen) { 319 xml.closeTag(tag); 320 } 321 322 return aceOpen; 311 323 } 312 324 313 325 private void emitAceWho(Ace ace) throws Throwable { 314 xml.openTag(WebdavTags.ace);315 316 326 boolean invert = ace.getNotWho(); 317 327 trunk/calendar3/appcommon/src/org/bedework/appcommon/EventFormatter.java
r320 r331 210 210 try { 211 211 if (xmlAccess == null) { 212 Acl acl = svci.getAcl(getEvent()); 212 // Acl acl = svci.getAcl(getEvent()); 213 Acl acl = eventInfo.getCurrentAccess().acl; 213 214 xmlAccess = AccessAppUtil.getXmlAclString(acl); 214 215 } trunk/calendar3/calCore/src/org/bedework/calcore/hibernate/AccessUtil.java
r320 r331 171 171 Collection aces) throws CalFacadeException { 172 172 try { 173 Acl acl = getAces(ent, privWriteAcl);173 Acl acl = checkAccess(ent, privWriteAcl, false).acl; 174 174 175 175 Iterator it = aces.iterator(); … … 182 182 183 183 ent.setAccess(new String(acl.encode())); 184 } catch (Throwable t) {185 throw new CalFacadeException(t);186 }187 }188 189 /** Return the acl representing the allowed access for the given object. This190 * may be derived from an object higher up the tree.191 *192 * @param ent193 * @return Acl194 * @throws CalFacadeException195 */196 public Acl getAcl(BwShareableDbentity ent) throws CalFacadeException {197 try {198 return getAces(ent, privReadAcl);199 } catch (CalFacadeAccessException cae) {200 Acl acl = new Acl();201 acl.defaultAccess();202 203 return acl;204 184 } catch (Throwable t) { 205 185 throw new CalFacadeException(t); … … 224 204 while (it.hasNext()) { 225 205 BwShareableDbentity sdbe = (BwShareableDbentity)it.next(); 226 if ( accessible(sdbe, desiredAccess, nullForNoAccess)) {206 if (checkAccess(sdbe, desiredAccess, nullForNoAccess).accessAllowed) { 227 207 out.add(sdbe); 228 208 } … … 232 212 } 233 213 234 /* Check access for the given entity. Returns the character representation of235 * the ace array.236 */237 boolean accessible(BwShareableDbentity ent, int desiredAccess,238 boolean nullForNoAccess) throws CalFacadeException {239 return checkAccess(ent, desiredAccess, nullForNoAccess).accessAllowed;240 }241 242 214 /* Check access for the given entity. Returns the current access 243 215 */ 244 216 CurrentAccess checkAccess(BwShareableDbentity ent, int desiredAccess, 245 boolean nullForNoAccess) throws CalFacadeException {217 boolean returnResult) throws CalFacadeException { 246 218 if (ent == null) { 247 return new CurrentAccess(); 248 } 249 250 if ((authUser != null) && superUser) { 251 // Nobody can stop us - BWAAA HAA HAA 252 CurrentAccess ca = new CurrentAccess(); 253 ca.accessAllowed = true; 254 255 return ca; 219 return null; 256 220 } 257 221 … … 263 227 } 264 228 265 char[] aclChars = getAclChars((BwShareableDbentity)ent);266 267 return checkAccess(aclChars, ent.getOwner(), desiredAccess,268 nullForNoAccess);269 }270 271 /** This does access checking for shareable objects and returns the merged272 * list of ace objects.273 *274 * @param ent BwShareableDbentity object275 * @param desiredAccess int access we want276 * @return Collection of merged Ace or null for no access277 * @throws CalFacadeException278 */279 Acl getAces(BwShareableDbentity ent, int desiredAccess)280 throws CalFacadeException {281 if (ent == null) {282 return null;283 }284 285 if (debug) {286 String cname = ent.getClass().getName();287 getLog().debug("Check access for object " +288 cname.substring(cname.lastIndexOf(".") + 1) +289 " with id " + ent.getId());290 }291 292 char[] aclChars = getAclChars((BwShareableContainedDbentity)ent);293 294 if ((authUser == null) || !superUser) {295 // Need to check access296 checkAccess(aclChars, ent.getOwner(), desiredAccess, false);297 }298 299 try {300 Acl acl = new Acl();301 acl.decode(aclChars);302 303 return acl;304 } catch (Throwable t) {305 throw new CalFacadeException(t);306 }307 }308 309 /* This does access checking given an acl string and owner.310 *311 * XXX Should we save the result of previous checks for a given312 * acl string + principal + owner + desiredAccess?313 *314 * @param aclChars char[] defining current acls for object315 * @param owner BwUser owner of the object316 * @param desiredAccess int access we want317 * @param returnResult if true we return false for no access else throw318 * an exception319 * @return CurrentAccess access + allowed/disallowed320 */321 private CurrentAccess checkAccess(char[] aclChars, BwUser owner, int desiredAccess,322 boolean returnResult) throws CalFacadeException {323 324 229 try { 325 230 CurrentAccess ca; 231 String account = ent.getOwner().getAccount(); 232 233 char[] aclChars = getAclChars(ent); 234 326 235 if (desiredAccess == privRead) { 327 ca = access.checkRead(authUser, owner.getAccount(), 328 aclChars); 236 ca = access.checkRead(authUser, account, aclChars); 329 237 } else if (desiredAccess == privWrite) { 330 ca = access.checkReadWrite(authUser, owner.getAccount(), 331 aclChars); 238 ca = access.checkReadWrite(authUser, account, aclChars); 332 239 } else { 333 /* Do it the awkward way */ 334 ca = access.evaluateAccess(authUser, owner.getAccount(), 335 desiredAccess, aclChars); 336 } 337 240 ca = access.evaluateAccess(authUser, account, desiredAccess, aclChars); 241 } 242 243 if ((authUser != null) && superUser) { 244 // Nobody can stop us - BWAAA HAA HAA 245 ca.accessAllowed = true; 246 } 247 338 248 if (!ca.accessAllowed && !returnResult) { 339 249 throw new CalFacadeAccessException(); trunk/calendar3/calCore/src/org/bedework/calcore/hibernate/Calendars.java
r320 r331 64 64 import java.util.Collection; 65 65 import java.util.Iterator; 66 import java.util.TreeSet; 66 67 67 68 /** Class to encapsulate most of what we do with calendars … … 204 205 sess.cacheableQuery(); 205 206 206 return access.checkAccess(sess.getList(), privWrite, true);207 return postGet(sess.getList(), privWrite); 207 208 } 208 209 … … 226 227 sess.cacheableQuery(); 227 228 228 return access.checkAccess(sess.getList(), privWrite, noAccessReturnsNull);229 return postGet(sess.getList(), privWrite); 229 230 } 230 231 … … 260 261 261 262 if (cal != null) { 262 access.accessible(cal, privRead, false); 263 // Need to clone for this 264 //cal.setCurrentAccess(access.checkAccess(cal, privRead, false)); 265 access.checkAccess(cal, privRead, false); 263 266 } 264 267 … … 276 279 277 280 if (cal != null) { 278 access.accessible(cal, privRead, false); 281 // Need to clone for this 282 //cal.setCurrentAccess(access.checkAccess(cal, privRead, false)); 283 access.checkAccess(cal, privRead, false); 279 284 } 280 285 … … 312 317 313 318 /* We need write access to the parent */ 314 access. accessible(parent, privWrite, false);319 access.checkAccess(parent, privWrite, false); 315 320 316 321 /** Is the parent a calendar collection? … … 411 416 * ==================================================================== */ 412 417 418 /* Return a Collection of the calendars after checking access 419 * 420 */ 421 private Collection postGet(Collection cals, int desiredAccess) 422 throws CalFacadeException { 423 TreeSet out = new TreeSet(); 424 425 Iterator it = cals.iterator(); 426 427 while (it.hasNext()) { 428 BwCalendar cal = (BwCalendar)it.next(); 429 CurrentAccess ca = access.checkAccess(cal, desiredAccess, 430 noAccessReturnsNull); 431 if (ca != null) { 432 //cal.setCurrentAccess(ca); 433 out.add(cal); 434 } 435 } 436 437 return out; 438 } 439 413 440 /* Returns the cloned (sub)tree of calendars to which user has access 414 441 * trunk/calendar3/calCore/src/org/bedework/calcore/hibernate/CalintfImpl.java
r321 r331 54 54 package org.bedework.calcore.hibernate; 55 55 56 import edu.rpi.cct.uwcal.access.Acl;57 56 import edu.rpi.cct.uwcal.access.PrivilegeDefs; 58 57 … … 497 496 try { 498 497 if (sess != null) { 498 if (sess.transactionStarted()) { 499 sess.rollback(); 500 } 499 501 sess.disconnect(); 500 502 } … … 692 694 access.changeAccess(ent, aces); 693 695 sess.saveOrUpdate(ent); 694 }695 696 public Acl getAcl(BwShareableDbentity ent) throws CalFacadeException {697 checkOpen();698 return access.getAcl(ent);699 696 } 700 697 trunk/calendar3/calCore/src/org/bedework/calcore/hibernate/HibSession.java
r300 r331 249 249 } 250 250 251 /** Return true if we have a transaction started 252 * 253 * @return boolean 254 */ 255 public boolean transactionStarted() { 256 return tx != null; 257 } 258 251 259 /** Commit a transaction 252 260 * trunk/calendar3/calFacade/src/org/bedework/calfacade/base/CalintfBase.java
r321 r331 86 86 import org.apache.log4j.Logger; 87 87 88 import edu.rpi.cct.uwcal.access.Acl;89 90 88 /** Base Implementation of CalIntf which throws exceptions for most methods. 91 89 * … … 378 376 } 379 377 380 public Acl getAcl(BwShareableDbentity ent) throws CalFacadeException {381 checkOpen();382 throw new CalFacadeUnimplementedException();383 }384 385 378 /* ==================================================================== 386 379 * Timezones trunk/calendar3/calFacade/src/org/bedework/calfacade/ifs/Calintf.java
r314 r331 68 68 import org.bedework.calfacade.filter.BwFilter; 69 69 import org.bedework.calfacade.ifs.Groups; 70 71 import edu.rpi.cct.uwcal.access.Acl;72 70 73 71 import java.util.Collection; … … 365 363 Collection aces) throws CalFacadeException; 366 364 367 /** Return the acl representing the allowed access for the given object. This368 * may be derived from an object higher up the tree.369 *370 * @param ent371 * @return Acl372 * @throws CalFacadeException373 */374 public Acl getAcl(BwShareableDbentity ent) throws CalFacadeException;375 376 365 /* ==================================================================== 377 366 * Timezones trunk/calendar3/calFacade/src/org/bedework/calfacade/ifs/EventsI.java
r321 r331 156 156 * @param cal CalendarVO object 157 157 * @param val String possible name 158 * @return Collection of EventVO or null158 * @return Collection of CoreEventInfo objects 159 159 * @throws CalFacadeException 160 160 */ trunk/calendar3/caldav/src/edu/rpi/cct/uwcal/caldav/CaldavBWIntf.java
r320 r331 289 289 CaldavComponentNode cnode = (CaldavComponentNode)uwnode; 290 290 291 BwEvent ev = cnode.getEvent ();291 BwEvent ev = cnode.getEventInfo().getEvent(); 292 292 293 293 if (ev != null) { … … 808 808 svci.updateCalendar(cal); 809 809 } else { 810 BwEvent ev = ((CaldavComponentNode)node).getEvent ();810 BwEvent ev = ((CaldavComponentNode)node).getEventInfo().getEvent(); 811 811 812 812 svci.changeAccess(ev, info.aces); … … 827 827 try { 828 828 if (cdUri.isCalendar()) { 829 acl = getSvci().getAcl(cdUri.getCal());829 acl = cdUri.getCal().getCurrentAccess().acl; 830 830 } else { 831 acl = getSvci().getAcl(((CaldavComponentNode)node).getEvent());831 acl = ((CaldavComponentNode)node).getEventInfo().getCurrentAccess().acl; 832 832 } 833 833 trunk/calendar3/caldav/src/edu/rpi/cct/uwcal/caldav/CaldavComponentNode.java
r2 r331 56 56 57 57 import org.bedework.calfacade.BwEvent; 58 import org.bedework.calfacade.svc.EventInfo; 58 59 59 60 import org.bedework.calsvci.CalSvcI; … … 81 82 public class CaldavComponentNode extends CaldavBwNode { 82 83 /* The only event or the master */ 83 private BwEvent event; 84 // private BwEvent event; 85 private EventInfo eventInfo; 84 86 85 87 /* Collection of BwEvent for this node … … 126 128 127 129 try { 128 if ((event != null) && (vevent == null)) {129 Calendar ical = trans.toIcal(event );130 if ((eventInfo != null) && (vevent == null)) { 131 Calendar ical = trans.toIcal(eventInfo.getEvent()); 130 132 if (events.size() == 1) { 131 133 this.ical = ical; // Save doing it again … … 160 162 161 163 try { 162 if ((event == null) && exists) {164 if ((eventInfo == null) && exists) { 163 165 String entityName = cdURI.getEntityName(); 164 166 … … 181 183 if (events.size() == 1) { 182 184 /* Non recurring or no overrides */ 183 event = (BwEvent)events.iterator().next();185 eventInfo = (EventInfo)events.iterator().next(); 184 186 } else { 185 187 /* Find the master */ … … 187 189 Iterator it = events.iterator(); 188 190 while (it.hasNext()) { 189 BwEvent ev = (BwEvent)it.next();190 191 if (e v.getRecurring()) {192 event = ev;191 EventInfo ei = (EventInfo)it.next(); 192 193 if (ei.getEvent().getRecurring()) { 194 eventInfo = ei; 193 195 } 194 196 } 195 197 196 if (event == null) {198 if (eventInfo == null) { 197 199 throw new WebdavIntfException("Missing master for " + cdURI); 198 200 } … … 201 203 } 202 204 203 if (event != null) { 205 if (eventInfo != null) { 206 BwEvent event = eventInfo.getEvent(); 207 204 208 creDate = event.getCreated(); 205 209 lastmodDate = event.getLastmod(); … … 226 230 /** Returns the only event or the master event for a recurrence 227 231 * 228 * @return BwEvent232 * @return EventInfo 229 233 * @throws WebdavIntfException 230 234 */ 231 public BwEvent getEvent() throws WebdavIntfException {232 init(true); 233 234 return event ;235 public EventInfo getEventInfo() throws WebdavIntfException { 236 init(true); 237 238 return eventInfo; 235 239 } 236 240 … … 245 249 if (ical == null) { 246 250 if (events.size() == 1) { 247 ical = trans.toIcal(event );251 ical = trans.toIcal(eventInfo.getEvent()); 248 252 } else { 249 253 // recurring trunk/calendar3/calsvc/src/org/bedework/calsvc/CalSvc.java
r321 r331 98 98 //import org.bedework.mail.MailerIntf; 99 99 100 import edu.rpi.cct.uwcal.access.Acl;101 100 import edu.rpi.cct.uwcal.resources.Resources; 102 101 … … 568 567 Collection aces) throws CalFacadeException { 569 568 getCal().changeAccess(ent, aces); 570 }571 572 public Acl getAcl(BwShareableDbentity ent) throws CalFacadeException {573 return getCal().getAcl(ent);574 569 } 575 570 … … 1737 1732 public Collection findEventsByName(BwCalendar cal, String val) 1738 1733 throws CalFacadeException { 1739 return getCal().getEventsByName(cal, val);1734 return postProcess(getCal().getEventsByName(cal, val), (BwSubscription)null); 1740 1735 } 1741 1736 trunk/calendar3/calsvci/src/org/bedework/calsvci/CalSvcI.java
r321 r331 82 82 import org.bedework.icalendar.IcalCallback; 83 83 84 import edu.rpi.cct.uwcal.access.Acl;85 84 import edu.rpi.cct.uwcal.resources.Resources; 86 85 … … 410 409 public abstract void changeAccess(BwShareableDbentity ent, 411 410 Collection aces) throws CalFacadeException; 412 413 /** Return the ace representing the allowed access for the given object. This414 * may be derived from an object higher up the tree.415 *416 * @param ent417 * @return Acl418 * @throws CalFacadeException419 */420 public abstract Acl getAcl(BwShareableDbentity ent) throws CalFacadeException;421 411 422 412 /* ==================================================================== … … 1243 1233 * a new purpose, which indicates the event is hidden for this user. 1244 1234 * 1245 * @param event EventVOobject1235 * @param event BwEvent object 1246 1236 * @return boolean false for no such item. 1247 1237 * @throws CalFacadeException … … 1262 1252 * @param cal CalendarVO object 1263 1253 * @param val String possible name 1264 * @return Collection of Event VOor null1254 * @return Collection of EventInfo or null 1265 1255 * @throws CalFacadeException 1266 1256 */ trunk/calendar3/lib/tlds/bedework.tld
r320 r331 58 58 <tagclass>org.bedework.webcommon.taglib.EmitCurrentPrivsTag</tagclass> 59 59 <bodycontent>empty</bodycontent> 60 <info>Emit txtin a tag</info>60 <info>Emit xml version of current privs in a tag</info> 61 61 62 62 <attribute> … … 84 84 </attribute> 85 85 </tag> 86 87 <tag> 88 <name>emitAcl</name> 89 <tagclass>org.bedework.webcommon.taglib.EmitAclTag</tagclass> 90 <bodycontent>empty</bodycontent> 91 <info>Emit xml version of acl in a tag</info> 92 93 <attribute> 94 <name>name</name> 95 <required>true</required> 96 <rtexprvalue>false</rtexprvalue> 97 </attribute> 98 99 <attribute> 100 <name>property</name> 101 <required>false</required> 102 <rtexprvalue>false</rtexprvalue> 103 </attribute> 104 105 <attribute> 106 <name>scope</name> 107 <required>false</required> 108 <rtexprvalue>false</rtexprvalue> 109 </attribute> 110 </tag> 86 111 </taglib> 87 112 trunk/calendar3/webclient/war/docs/calendar/emitCalendar.jsp
r320 r331 11 11 <bw:emitText name="calendar" property="mailListId" /> 12 12 <bw:emitCurrentPrivs name="calendar" property="currentAccess" /> 13 <bw:emitAcl name="calendar" property="currentAccess" /> 13 14 14 15 <logic:iterate name="calendar" property="children" id="cal"> trunk/calendar3/webcommon/src/org/bedework/webcommon/BwAbstractAction.java
r302 r331 468 468 */ 469 469 470 String reqpar = request.getParameter("adminGroupName");470 String reqpar = getReqPar(request, "adminGroupName"); 471 471 if (reqpar == null) { 472 472 // Make them do it again. … … 591 591 592 592 BwAdminGroup ag = (BwAdminGroup)adgrps.findGroup(groupName); 593 if (ag != null) { 594 adgrps.getMembers(ag); 595 } 593 596 594 597 if (debug) { … … 933 936 par.svlt = servlet; 934 937 par.req = request; 935 936 try { 937 ua = svci.getUserAuth(user, par); 938 939 form.assignAuthorisedUser(ua.getUsertype() != UserAuth.noPrivileges); 940 svci.setSuperUser((ua.getUsertype() & UserAuth.superUser) != 0); 941 942 // XXX access - disable use of roles 943 access = ua.getUsertype(); 944 945 if (debug) { 946 debugMsg("UserAuth says that current user has the type: " + 947 ua.getUsertype()); 938 939 if (publicAdmin) { 940 try { 941 ua = svci.getUserAuth(user, par); 942 943 form.assignAuthorisedUser(ua.getUsertype() != UserAuth.noPrivileges); 944 svci.setSuperUser((ua.getUsertype() & UserAuth.superUser) != 0); 945 946 // XXX access - disable use of roles 947 access = ua.getUsertype(); 948 949 if (debug) { 950 debugMsg("UserAuth says that current user has the type: " + 951 ua.getUsertype()); 952 } 953 } catch (Throwable t) { 954 form.getErr().emit("org.bedework.client.error.exc", t.getMessage()); 955 form.getErr().emit(t); 956 return false; 948 957 } 949 } catch (Throwable t) {950 form.getErr().emit("org.bedework.client.error.exc", t.getMessage());951 form.getErr().emit(t);952 return false;953 958 } 954 959 } catch (CalFacadeException cfe) {
