Open source cms for mobile and desktop websites

User and security functions.

Loads all users from user database if available.

class, id=0)

A fake user object for testing.


check if user has one of these groups


failed login


Can be used in getuser listeners to break user lookup and pass a session user to LookupUser. The second argument is the session user

class, ident)

Admin User object with groups and login possibility.


check if user has one of these groups, context)

Can be used during object initialisation to process acls. Acls can have a additional callback parameter called with the context to find out whetther to apply the single acl or not. The callback should return true or false. e.g.

(Allow, "group:reader", "read", lambda context: context.meta.pool_state),


def check(context):
    return context.meta.pool_state

(Allow, "group:reader", "read", check),
  • acl
  • context

tuple of acls to be stored as __acl__


LocalGroups extension module

Security extension to handle local group assginments for users. Can be used for Roots and Objects or any other python class supporting events and id attribute (number). Uses idhash for root objects.

class nive.extensions.localgroups.LocalGroups
GetLocalGroups(username, user=None)

Group assignments use the user name. returns a list of all local user groups, including parent settings


returns a list of all local user group settings as list including [username, group, id]. This function does not include parent level settings.

AddOwner(user, **kw)

Add the current user as group:owner to local roles

AddLocalGroup(username, group)

Add a local group assignment for username.

RemoveLocalGroups(username, group=None)

Remove a local group assignment. If group is None all local groups will be removed.


Remove all group assignments before deleting the object.

© 2013 Nive GmbH