Examples of AccessPermission


Examples of com.filenet.api.security.AccessPermission

    LOGGER.log(Level.FINE, "Authorizing user:[" + user.get_Name() + "]");

    while (iter.hasNext()) {
      try {
        AccessPermission perm = (AccessPermission) iter.next();
        Integer accessMask = perm.get_AccessMask();
        LOGGER.log(Level.FINEST, "Access Mask is:[" + accessMask + "]");

        if (AccessType.DENY.equals(perm.get_AccessType())) {
          // Checking for denied read or view content rights.  If either one is
          // true and user is a member of the ACE, the user is not authorized.
          if ((VIEW_ACCESS_RIGHTS & accessMask) != 0
              && matchesUser(perm, user)) {
            LOGGER.log(Level.FINEST,
                "Access is denied for user {0} via grantee {1}",
                new Object[] {user.get_Name(), perm.get_GranteeName()});
            return false;
          }
        } else {
          // Compare to make sure that the access level, to user for a
          // document, is at least view or above
View Full Code Here

Examples of com.gitblit.Constants.AccessPermission

    String username = StringUtils.encodeUsername(UserModel.ANONYMOUS.equals(user) ? "" : user.username);

    List<RepositoryUrl> list = new ArrayList<RepositoryUrl>();
    // http/https url
    if (settings.getBoolean(Keys.git.enableGitServlet, true)) {
      AccessPermission permission = user.getRepositoryPermission(repository).permission;
      if (permission.exceeds(AccessPermission.NONE)) {
        list.add(new RepositoryUrl(getRepositoryUrl(request, username, repository), permission));
      }
    }

    // add all other urls
View Full Code Here

Examples of com.gitblit.Constants.AccessPermission

    return null;
  }

  public AccessPermission getGitDaemonAccessPermission(UserModel user, RepositoryModel repository) {
    if (gitDaemon != null && user.canClone(repository)) {
      AccessPermission gitDaemonPermission = user.getRepositoryPermission(repository).permission;
      if (gitDaemonPermission.atLeast(AccessPermission.CLONE)) {
        if (repository.accessRestriction.atLeast(AccessRestrictionType.CLONE)) {
          // can not authenticate clone via anonymous git protocol
          gitDaemonPermission = AccessPermission.NONE;
        } else if (repository.accessRestriction.atLeast(AccessRestrictionType.PUSH)) {
          // can not authenticate push via anonymous git protocol
View Full Code Here

Examples of net.jini.security.AccessPermission

    /**
     * Return an AccessPermission instance with the given target.
     */
    public static AccessPermission ap(String name) {
  return new AccessPermission(name);
    }
View Full Code Here

Examples of org.apache.pdfbox.pdmodel.encryption.AccessPermission

      // Decrypt the PDF-Dokument
      if (pdfDocument.isEncrypted()) {
        mLog.debug("Document is encrypted: " + url);
        StandardDecryptionMaterial sdm = new StandardDecryptionMaterial("");
        pdfDocument.openProtection(sdm);
        AccessPermission ap = pdfDocument.getCurrentAccessPermission();

        if (!ap.canExtractContent()) {
          throw new RegainException("Document is encrypted and can't be opened: " + url);
        }
      }

      // Extract the text with a utility class
View Full Code Here

Examples of org.apache.pdfbox.pdmodel.encryption.AccessPermission

                throw new Parser.Failure("Document is encrypted (2): " + e.getMessage(), location);
            } catch (final CryptographyException e) {
                try {pdfDoc.close();} catch (final IOException ee) {}
                throw new Parser.Failure("Document is encrypted (3): " + e.getMessage(), location);
            }
            final AccessPermission perm = pdfDoc.getCurrentAccessPermission();
            if (perm == null || !perm.canExtractContent())
                throw new Parser.Failure("Document is encrypted and cannot be decrypted", location);
        }

        // extracting some metadata
        final PDDocumentInformation info = pdfDoc.getDocumentInformation();
View Full Code Here

Examples of org.apache.pdfbox.pdmodel.encryption.AccessPermission

        throws CryptographyException, IOException
    {
        try
        {
            StandardProtectionPolicy policy =
                new StandardProtectionPolicy(ownerPassword, userPassword, new AccessPermission());
            this.protect(policy);
        }
        catch(BadSecurityHandlerException e)
        {
            throw new CryptographyException(e);
View Full Code Here

Examples of org.apache.pdfbox.pdmodel.encryption.AccessPermission

    {
        if(printJob == null)
        {
            throw new PrinterException( "The delivered printJob is null." );
        }
        AccessPermission currentPermissions = this.getCurrentAccessPermission();

        if(!currentPermissions.canPrint())
        {
            throw new PrinterException( "You do not have permission to print this document." );
        }
        printJob.setPageable(this);
        if( printJob.printDialog() )
View Full Code Here

Examples of org.apache.pdfbox.pdmodel.encryption.AccessPermission

    {
        if(printJob == null)
        {
            throw new PrinterException( "The delivered printJob is null." );
        }
        AccessPermission currentPermissions = this.getCurrentAccessPermission();

        if(!currentPermissions.canPrint())
        {
            throw new PrinterException( "You do not have permission to print this document." );
        }
        printJob.setPageable(this);
        printJob.print();
View Full Code Here

Examples of org.apache.pdfbox.pdmodel.encryption.AccessPermission

        {
            usage();
        }
        else
        {
            AccessPermission ap = new AccessPermission();

            String infile = null;
            String outfile = null;
            String certFile = null;
            String userPassword = "";
            String ownerPassword = "";

            int keyLength = 40;

            PDDocument document = null;

            try
            {
                for( int i=0; i<args.length; i++ )
                {
                    String key = args[i];
                    if( key.equals( "-O" ) )
                    {
                        ownerPassword = args[++i];
                    }
                    else if( key.equals( "-U" ) )
                    {
                        userPassword = args[++i];
                    }
                    else if( key.equals( "-canAssemble" ) )
                    {
                        ap.setCanAssembleDocument(args[++i].equalsIgnoreCase( "true" ));
                    }
                    else if( key.equals( "-canExtractContent" ) )
                    {
                        ap.setCanExtractContent( args[++i].equalsIgnoreCase( "true" ) );
                    }
                    else if( key.equals( "-canExtractForAccessibility" ) )
                    {
                        ap.setCanExtractForAccessibility( args[++i].equalsIgnoreCase( "true" ) );
                    }
                    else if( key.equals( "-canFillInForm" ) )
                    {
                        ap.setCanFillInForm( args[++i].equalsIgnoreCase( "true" ) );
                    }
                    else if( key.equals( "-canModify" ) )
                    {
                        ap.setCanModify( args[++i].equalsIgnoreCase( "true" ) );
                    }
                    else if( key.equals( "-canModifyAnnotations" ) )
                    {
                        ap.setCanModifyAnnotations( args[++i].equalsIgnoreCase( "true" ) );
                    }
                    else if( key.equals( "-canPrint" ) )
                    {
                        ap.setCanPrint( args[++i].equalsIgnoreCase( "true" ) );
                    }
                    else if( key.equals( "-canPrintDegraded" ) )
                    {
                        ap.setCanPrintDegraded( args[++i].equalsIgnoreCase( "true" ) );
                    }
                    else if( key.equals( "-certFile" ) )
                    {
                        certFile = args[++i];
                    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.