Coder Social home page Coder Social logo

dexterity.membrane's Introduction

Introduction

dexterity.membrane enables dexterity content items to be used as users and groups in Plone sites and integrates with Products.membrane.

Compatibility

This package has been developed for Plone 4.1. In fact it will only work on that version (or higher) as we require uuid support.

We depend on Products.membrane 2.0.2 or higher as that contains a fix to make sure members that are deleted are also removed from the membrane_tool catalog.

User id

As user id we use the uuid that is generated for the content item. This only works on Plone 4.1 and higher. See the definition of getUserId in the membraneuser.py behavior.

If you define your own member content type, you should enable the plone.app.referenceablebehavior.referenceable.IReferenceable behavior on it as that gives uuid support. This also means members can be referenced from Archetypes content.

Email as login name

This package contains a member content type that has an email field. This is used as login name by the behavior. See getUserName. Other implementations are possible, so we do not force you to use the email address as the login name in your site.

By default, this is on, but you can switch it off in our control panel. The setting is saved in the Plone registry.

Next to this, it is probably a good idea to also switch on the use_email_as_login property of Plone itself. The only effect this has as far as this package is concerned, is that some text in login forms is changed: you see 'email address' as label instead of 'login name', mostly. To enable this, you can put this in propertiestool.xml, possibly in a custom package for your project:

<?xml version="1.0"?>
<object name="portal_properties" meta_type="Plone Properties Tool">
  <object name="site_properties" meta_type="Plone Property Sheet">
    <property name="use_email_as_login" type="boolean">True</property>
  </object>
</object>

Member content type

This package defines a member content type, but this may be considered an example; feel free to create a different type and only use the behaviors or create your own adaptations of them.

Behaviors

  • dexterity.membrane.behavior.membraneuser.IMembraneUser: this makes the content behave as a membrane user, defining a way to get the user id (getUserId) and login name (getUserName).
  • dexterity.membrane.behavior.membranepassword.IProvidePasswords: adds a password and confirmation field to your dexterity content. This is used during authentication.
  • dexterity.membrane.behavior.membranegroup.IMembraneGroup: this makes the content behave as a membrane group, defining a way to get the group id (getGroupId) and group name (getGroupName).

Membrane implementation

  • Products.membrane.interfaces.IMembraneUserAuth: we implement authentication using the email field and the password field.
  • Products.membrane.interfaces import IMembraneUserProperties: we provide a read-only mapping from the first and last name fields of our own IMember schema to the fullname user property. We have a read-write mapping for the email, home_page/homepage and description/bio properties/fields for IMember.

Local roles

This package defines a local role provider that makes sure a logged in user gets the local Reader, Editor and Creator roles on the membrane object that belongs to that user.

Workflow

We define a simple workflow with pending/approved states. A user can only login when in the approved state.

dexterity.membrane's People

Contributors

adam139 avatar adniel avatar agitator avatar agnogueira avatar cedricmessiant avatar datakurre avatar davisagli avatar hvelarde avatar jensens avatar mauritsvanrees avatar saily avatar

Watchers

 avatar  avatar

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.