Package com.google.walkaround.wave.server.conv.PermissionCache

Examples of com.google.walkaround.wave.server.conv.PermissionCache.Permissions


    this.permissionCache = permissionCache;
  }

  @Override
  public void checkCanRead(SlobId id) throws AccessDeniedException {
    Permissions perms = getPerms(id);
    if (!perms.canRead()) {
      throw new AccessDeniedException("No read access to " + id + ": " + perms);
    }
  }
View Full Code Here


    }
  }

  @Override
  public void checkCanModify(SlobId id) throws AccessDeniedException {
    Permissions perms = getPerms(id);
    if (!perms.canWrite()) {
      throw new AccessDeniedException("No write access to " + id + ": " + perms);
    }
  }
View Full Code Here

              try {
                ConvMetadata metadata = convMetadataStore.get(tx, slobId);
                if (metadata.hasImportMetadata()
                    && !metadata.getImportMetadata().getImportFinished()) {
                  log.info(slobId + " still importing; " + participantId + " may not access");
                  return new Permissions(false, false);
                }
                // Can't use SlobStore here, that would be a cyclic dependency.
                MutationLog mutationLog = convSlobFacilities.getMutationLogFactory()
                    .create(tx, slobId);
                StateAndVersion stateAndVersion = mutationLog.reconstruct(null);
                if (stateAndVersion.getVersion() == 0) {
                  log.info(slobId + " does not exist; " + participantId + " may not access");
                  return new Permissions(false, false);
                }
                // TODO(ohler): introduce generics to avoid the cast.
                ReadableWaveletObject wavelet = (ReadableWaveletObject) stateAndVersion.getState();
                if (wavelet.getParticipants().contains(participantId)) {
                  log.info(slobId + " exists and " + participantId + " is on the participant list");
                  return new Permissions(true, true);
                } else {
                  log.info(slobId + " exists but "
                      + participantId + " is not on the participant list");
                  return new Permissions(false, false);
                }
              } finally {
                tx.close();
              }
            }
View Full Code Here

TOP

Related Classes of com.google.walkaround.wave.server.conv.PermissionCache.Permissions

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.