[Zope-CMF] Permissions in Document class

Jeff Ross thejeffross@hotmail.com
Thu, 29 Aug 2002 13:46:39 -0700


Right again Dieter. Thanks for your response.

For those interested, here is the code I'm using:

################################################################

def addPermission(obj, permission):

    found = 0

    for perm in obj.__ac_permissions__:
        if perm[0] == permission:
            found = 1
            break

    if not found:
        obj.__ac_permissions__ = obj.__ac_permissions__ + ((permission,
()),)

#################################################################

Now, my permission shows up in the Security tab. The code checks to see if
the permission was added so that
refreshes don't continually add the permission.

Jeff