Giter Club home page Giter Club logo

Comments (7)

polyester avatar polyester commented on June 28, 2024

On 2012-05-09 03:39, Elizabeth Leddy wrote:

I have no idea if anyone still uses this plugin but me so I'll open
an issue first and see. When using this product, we don't need to
show the login bar when unauthenticated OR the search bar, since they
both lead no where. It's easy to override this in zcml (code below).
should this be part of the standard offering for this package?

I use it extensively, and this is a good and logical idea.

from iw.rejectanonymous.

glenfant avatar glenfant commented on June 28, 2024

Hi,

It's somehow difficult to make a definitive answer to this kind of issue. I can understand that this is an issue, but this bunch of ZCML will affect all sites of your Zope instance, even the ones for which iw.rejectanonymous is not enabled.

Perhaps (untested) re-registering the viewlets with a "for" attribute like this would work, since the "for" attribute is a registration discriminator (see zope.viewlet.metaconfigure.viewletDirective):

<browser:viewlet
    name="plone.personal_bar"
    for="iw.rejectanonymous.IPrivateSite"
    manager="plone.app.layout.viewlets.interfaces.IPortalHeader"
    class="plone.app.layout.viewlets.common.PersonalBarViewlet"
    permission="cmf.ListFolderContents"
    />

Otherwise this would require to change dynamically the viewlet's permission or visibility in the iw.rejectanonymous.rejectAnonymous function.

HTH

Gilles

from iw.rejectanonymous.

tdesvenain avatar tdesvenain commented on June 28, 2024

What do you think about working with a layer ?

On Wed, May 9, 2012 at 12:29 PM, Gilles Lenfant <
[email protected]

wrote:

Hi,

It's somehow difficult to make a definitive answer to this kind of issue.
I can understand that this is an issue, but this bunch of ZCML will affect
all sites of your Zope instance, even the ones for which iw.rejectanonymous
is not enabled.

Perhaps (untested) re-registering the viewlets with a "for" attribute like
this would work, since the "for" attribute is a registration discriminator
(see zope.viewlet.metaconfigure.viewletDirective):

<browser:viewlet
   name="plone.personal_bar"
   for="iw.rejectanonymous.IPrivateSite"
    manager="plone.app.layout.viewlets.interfaces.IPortalHeader"
   class="plone.app.layout.viewlets.common.PersonalBarViewlet"
   permission="cmf.ListFolderContents"
   />

Otherwise this would require to change dynamically the viewlet's
permission or visibility in the iw.rejectanonymous.rejectAnonymous
function.

HTH

Gilles


Reply to this email directly or view it on GitHub:

#1 (comment)

Thomas Desvenain

Téléphone : 09 51 37 35 18

from iw.rejectanonymous.

eleddy avatar eleddy commented on June 28, 2024

I'm up for the layer or testing out the Private site interface option. I personally added this code for a specific layer but I confess that I never have more than one so I don't know the intricate details on that. The lazy dev in me wants to try the interface way but if layers are where its at I'll go that route

from iw.rejectanonymous.

glenfant avatar glenfant commented on June 28, 2024

Hi Thomas and Liz,

Just tested the suggested solution : it works like a charm on Plone 4.1 (and certainly on 3.x) and has no side effect on sites of the same Zope instance on which the "private site" feature is disabled.

Anyway, I'd prefer something like :

hiddenViewlets = set(('plone.personal_bar', 'plone.searchbox'))

That would make customisation less noisy. But I need to go in depth of - perhaps private - stuffs of viewlets and viewlet managers.

Liz : I suggest using a permission granted to an "Authenticated" user (say "Set own properties") rather than a permission granted to a "Contributor". Other opinion around ?

Thomas : An additional layer is somehow overkill IMHO. This component has no (and does not need) a GS profile and does not record persistent data, except the IPrivateSite marker interface. Let's KISS.

My beer !
Gilles

from iw.rejectanonymous.

glenfant avatar glenfant commented on June 28, 2024

Fixed in the master. Please test with it and reopen this issue with detailed comment if it does not work for you.

from iw.rejectanonymous.

eleddy avatar eleddy commented on June 28, 2024

most excellent!

from iw.rejectanonymous.

Related Issues (8)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.