Giter Club home page Giter Club logo

iw.rejectanonymous's Introduction

iw.rejectanonymous

What is iw.rejectanonymous ?

This package is made to reject unconditionnally anonymous users from a Plone site, without any change in your security policy matrix or workflows. They should get redirected by plone to login form. The basic use case is an extranet, where all visitors must be authenticated.

Works with

Plone 3, 4, 5

Installation

Add iw.rejectanonymous to the eggs option of your plone.recipe.zope2instance part

...
[instance]
recipe = plone.recipe.zope2instance
...
eggs =
    ...
    iw.rejectanonymous
    ...
...
# The ZCML slug is no more required with Plone 3.3 and up
zcml =
    ...
    iw.rejectanonymous
    ...

Re-run buildout, then open the "Security" control panel of any Plone site of your instance. A new Private site checkbox lets you (de)activate iw.rejectanonymous.

Customization

iw.rejectanonymous enables the publication of some resources to the anonymous user, more specifically to enable all media and resources required from the standard loging page and the password reset page.

Adding valid ids

If your customized logging page requires some specific images or your site policy component provides a signup page which name is not login_form you may add additional ids (url last part) that are available to anonymous users.

from iw.rejectanonymous import addValidIds
...
addValidIds('some_image.png', 'my_login_form')

Adding valid subparts

If you want to let anonymous users browse the pages of some folders, you need to add valid subparts.

from iw.rejectanonymous import addValidSubparts
...
addValidSubparts('disclaimer', 'public_section')

Adding valid subparts prefixes

If you want to let anonymous users browse the pages of some folders with specific prefixes, you need to add valid subpart prefixes.

from iw.rejectanonymous import addValidSubpartPrefixes
...
addValidSubpartPrefixes('public_')

Hiding viewlets

You may hide viewlets from the views of the site (login form, password reset form). You need for this to add such lines in your site policy ZCML.

<browser:viewlet
  name="original.viewlet.name"
  for="iw.rejectanonymous.IPrivateSite"
  manager="original.viewlet.manager.Interface"
  class="original.viewlet.Class"
  permission="cmf.SetOwnProperties"
/>
name
Keep the original viewlet name.
for
iw.rejectanonymous.IPrivateSite the marker interface set to private sites
manager
Keep the original manager
class
Keep the original viewlet class
permission
Choose a permission that is not granted to an anonymous user but to anyone else. cmf.SetOwnProperties is a good choice if your site has the standard security policy.

See how we hide the plone.personal_bar and the plone.searchbox in the configure.zcml of this component.

Links

Cheeseshop
http://pypi.python.org/pypi/iw.rejectanonymous
Git repository
https://github.com/collective/iw.rejectanonymous
Issue tracker
https://github.com/collective/iw.rejectanonymous/issues
Old SVN repository (up to 1.0.2)
https://svn.plone.org/svn/collective/iw.rejectanonymous

Contributors

  • Bertrand Mathieu
  • Thomas Desvenain
  • Gilles Lenfant
  • Elisabeth Leddy

iw.rejectanonymous's People

Contributors

ale-rt avatar braytonosg avatar ebrehault avatar eleddy avatar esteele avatar glenfant avatar jaroel avatar mamico avatar mpeeters avatar tdesvenain avatar vincentfretin avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

iw.rejectanonymous's Issues

needs new release

this product hardcore breaks in plone 4.1.5 due to a zope security patch. All future releases will have the same patch.

doesn't work with plone.app.theming

I'm using both and seems they don't play well together:

File "lxml.etree.pyx", line 2706, in lxml.etree.parse (src/lxml/lxml.etree.c:49958)
File "parser.pxi", line 1500, in lxml.etree._parseDocument (src/lxml/lxml.etree.c:71797)
File "parser.pxi", line 1529, in lxml.etree._parseDocumentFromURL (src/lxml/lxml.etree.c:72080)
File "parser.pxi", line 1429, in lxml.etree._parseDocFromFile (src/lxml/lxml.etree.c:71175)
File "parser.pxi", line 975, in lxml.etree._BaseParser._parseDocFromFile (src/lxml/lxml.etree.c:68173)
File "parser.pxi", line 539, in lxml.etree._ParserContext._handleParseResultDoc (src/lxml/lxml.etree.c:64257)
File "parser.pxi", line 625, in lxml.etree._handleParseResult (src/lxml/lxml.etree.c:65178)
File "parser.pxi", line 563, in lxml.etree._raiseParseError (src/lxml/lxml.etree.c:64493)
IOError: Error reading file '/++theme++plonetheme.test/rules.xml': failed to load external entity "/++theme++plonetheme.test/rules.xml"

I don't have any idea how to fix this ...

hiding login bar and search

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?

<browser:viewlet
    name="plone.searchbox"
    manager="plone.app.layout.viewlets.interfaces.IPortalHeader"
    class="plone.app.layout.viewlets.common.SearchBoxViewlet"
    permission="cmf.ListFolderContents"
    />

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

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.