Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8451173
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T11:09:57+00:00 2026-06-10T11:09:57+00:00

I’m back to using Plone after a very long time without using it. We

  • 0

I’m back to using Plone after a very long time without using it. We have setup an Intranet with Plone 4.0.5. We have upload lots of documents (mostly File) to the intranet.

The site was installed using the Plone Unified Installer with a ZEO configuration. Some products (eggs) were added (if you need some part of our buildout.cfg and/or versions.cfg; please ask for it) to our buildout.cfg

With both the ZEO server and clients running; I’m doing:

 $ bin/client1 debug
 Starting debugger (the name "app" is bound to the top-level Zope object)
 ... several warnings ...
 >>>

Now, I query the catalog like this:

 >>> len(app.plone.portal_catalog(portal_type="File"))
 17

However if go to the ZMI and traverse to the portal_catalog/Indexes, go to portal_type and browse, the “File” items has a lot more of elements.

This is probably because I have not logged in:

 >>> from Products.CMFCore.utils import _getAuthenticatedUser
 >>> _getAuthenticatedUser(app.ca.portal_catalog)
 <SpecialUser 'Anonymous User'>

How do I put the console in the “context” of an admin user?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T11:09:59+00:00Added an answer on June 10, 2026 at 11:09 am

    There can be several reasons the catalog doesn’t return all entries:

    • Their permission doesn’t allow you to see them, full stop. Using the anonymous user certainly doesn’t help in that regard. 🙂

    • The entries are expired; they have a expiration date that is now in the past and you don’t have permission to see these. Again, using a non-privileged user won’t help.

    • You are using a multi-lingual setup and the items are not in the ‘current’ language. If your query includes Language='all' this filter is disabled.

    To set an alternative user (preferably one with the Manager role) on the console, use the following code:

    from AccessControl.SecurityManagement import newSecurityManager
    
    site = app['Plone'] # Adjust as needed
    # Assuming your username is 'admin', adjust as needed again:
    user = app.acl_users.getUser('admin').__of__(site.acl_users) 
    newSecurityManager(None, user)
    

    Personally, I use the following snippet whenever I use the console; if have this in my Quicksilver Shelf for easy access. First I type in:

    site_id = '<id of Plone site>' # Adjust as needed
    

    then paste:

    import transaction, pdb
    from zope.interface import implementedBy
    from zope.component import getUtility, queryUtility, queryAdapter
    from Zope2 import debug
    from Acquisition import aq_inner, aq_parent, aq_chain
    from zope.app.component.hooks import setSite, getSiteManager
    from Testing.makerequest import makerequest
    from AccessControl.SecurityManagement import newSecurityManager, getSecurityManager
    
    try:
        import readline
    except ImportError:
        print "Module readline not available."
    else:
        import rlcompleter
        readline.parse_and_bind("tab: complete")
    
    app = makerequest(app)
    site = app[site_id]
    setSite(site)
    user = app.acl_users.getUser('admin').__of__(site.acl_users)
    newSecurityManager(None, user)
    

    Now I have readline completion and everything I need to do some real damage in my sites!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have thousands of HTML files to process using Groovy/Java and I need to
I have a reasonable size flat file database of text documents mostly saved in
I am using Paperclip to handle profile photo uploads in my app. They upload
I am trying to loop through a bunch of documents I have to put
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
For some reason, after submitting a string like this Jack’s Spindle from a text
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.