Package org.wymiwyg.rwcf.accesscontrol.jaas

Examples of org.wymiwyg.rwcf.accesscontrol.jaas.RPermission


    Set resultSet = new HashSet();
    StmtIterator statements = handlerResource
        .listProperties(RWCF.requiredPermission);
    while (statements.hasNext()) {
      Resource currentObject = statements.nextStatement().getResource();
      resultSet.add(new RPermission(currentObject));
    }
    statements.close();
    statements = handlerResource.listProperties(AUTHORIZATION.requires);
    while (statements.hasNext()) {
      Resource currentObject = statements.nextStatement().getResource();
      resultSet.add(new RPermission(currentObject));
    }
    statements.close();
    requiredPermissions = (Permission[]) resultSet
        .toArray(new Permission[resultSet.size()]);
  }
View Full Code Here


          // be cached, i.E. all checks from classes within the
          // current classpath entry to authorized
          Policy.setPolicy(new RPolicy());
          boolean isAdmin = false;
          try {
            AccessController.checkPermission(new RPermission(
                AUTHORIZATION.admin));
            isAdmin = true;
          } catch (Exception e) {
          }
          if (!isAdmin) {
View Full Code Here

  public static void checkPermssionOnResource(Resource resource) {
    StmtIterator requiresIter = resource
        .listProperties(AUTHORIZATION.requires);
    while (requiresIter.hasNext()) {
      Resource object = requiresIter.nextStatement().getResource();
      AccessController.checkPermission(new RPermission(object));
    }
    requiresIter.close();
  }
View Full Code Here

    // String extension
    if (lastDot > lastSlash) {
      requestURLString = requestURLString.substring(0, lastDot);
    }
    Resource resource = model.createResource(requestURLString);
    AccessController.checkPermission(new RPermission(AUTHORIZATION.edit));
    log.info("Handling Put of " + resource);
    InputStream in = (InputStream) request.getBody();
    ByteArrayOutputStream bOut = new ByteArrayOutputStream();
    try {
      for (int ch = in.read(); ch != -1; ch = in.read()) {
View Full Code Here

        }
        LanguageChooser.addLanguageSeq(ehRequest, model, resultModel);
        addMailingLists(resultModel);
        response.setHeader(HeaderName.CACHE_CONTROL, "max-age=1");
        try {
          AccessController.checkPermission(new RPermission(AUTHORIZATION.edit));
        } catch (Exception ex) {
          StmtIterator mboxes = resultModel.listStatements(null,FOAF.mbox, (Resource)null);
      while (mboxes.hasNext()) {
        mboxes.removeNext();
      }
View Full Code Here

    private static Permission[] getRequiredPermissions(Resource item) {
      Set resultSet = new HashSet();
      StmtIterator statements = item.listProperties(AUTHORIZATION.requires);
      while (statements.hasNext()) {
        Resource currentObject = statements.nextStatement().getResource();
        resultSet.add(new RPermission(currentObject));
      }
      return (Permission[]) resultSet
          .toArray(new Permission[resultSet.size()]);
    }
View Full Code Here

    resultModel.add(JenaUtil.getExpandedResource(DefaultValuesHandler
        .getDefaultsResource(model), 3));
    addMonths(resultModel, relevantMonths);
    addAreas(resultModel, relevantAreas);
     try {
            AccessController.checkPermission(new RPermission(AUTHORIZATION.edit));
          } catch (Exception ex) {
            StmtIterator mboxes = resultModel.listStatements(null,FOAF.mbox, (Resource)null);
        while (mboxes.hasNext()) {
          mboxes.removeNext();
        }
View Full Code Here

   
    resultModel.add(JenaUtil.getExpandedResource(model.createResource("urn://wymiwyg.org/knobot/shop-defaults"), 2));
   
    try {
      AccessController
          .checkPermission(new RPermission(AUTHORIZATION.edit));
    } catch (Exception ex) {
      StmtIterator mboxes = resultModel.listStatements(null, FOAF.mbox,
          (Resource) null);
      while (mboxes.hasNext()) {
        mboxes.removeNext();
View Full Code Here

      comment.addProperty(RDF.type, RWCF.AuthoritativelyServedResource);
      comment.addProperty(RDF.type, KNOBOT.Commentable);
      source = (Resource) relation.getProperty(KNOBOT.source)
          .getResource().inModel(model);
      if (!source.hasProperty(RDF.type, KNOBOT.Commentable)) {
        AccessController.checkPermission(new RPermission(
            AUTHORIZATION.edit));
      }
      // add same required permissions as for commented item
      addRequiredPermissions(source, comment);
      addNotificationsTargets(source, comment);
View Full Code Here

    Resource agent = agentProfileDocument.getProperty(FOAF.primaryTopic)
        .getResource();

    try {
      AccessController
          .checkPermission(new RPermission(AUTHORIZATION.edit));
    } catch (AccessControlException e) {
      Resource user = VirtuserHandler.getSubject();
      if (agent.equals(user)) {

      } else {
View Full Code Here

TOP

Related Classes of org.wymiwyg.rwcf.accesscontrol.jaas.RPermission

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.