Hi,
what is needed to finally get real user support integrated into Trac?
There is IUserDirectory, but that patch
(http://trac.edgewall.org/ticket/2456) wasn't accepted because it
didn't seem to make you happy. I'd like to work on a simple patch with
a new interface to finally make it possible for authentication plugins
to provide extra user data instead of using the session API.

What do you need, exactly?

Is the following interface good enough? It consists of two interfaces
which separate the user from his attributes. In order to make the API
centrally accessible, I'm planning to add a UserManager (as part of
the env) which will provide the same functions as the two interfaces.

class IUserDirectory(Interface):
    """
    Extension point interface for backends that store known users.
    """

    def get_known_users(self):
        """
        Generator that yields a list of known users.

        @return username
        """
        pass

    def delete_user(self, username):
        """
        Deletes the given user.
        """
        pass


class IUserAttributeProvider(Interface):
    """
    Extension point interface for backends that store user attributes.
    """

    def get_user_attribute(self, username, attribute):
        """
        Returns a user attribute.

        @param username: the user you want to get the attribute of
        @param attribute: the name of the attribute

        @return value
            Returns None if the attribute is not supported.
        """
        pass

    def set_user_attribute(self, username, attribute, value):
        """
        Sets a user attribute.

        @param username: the user you want to set the attribute of
        @param attribute: the name of the attribute
        @param value: the new value of the attribute

        @return success
            Returns False if setting the attribute is not supported.
        """
        pass

    def delete_user_attribute(self, username, attribute):
        """
        Deletes a user attribute.

        @param username: the affected user
        @param attribute: the name of the attribute that should be deleted
        """
        pass

    def delete_all_user_attributes(self, username):
        """
        Deletes all of the given user's attributes.
        """
        pass

Do you have any suggestions?

Bye,
Waldemar Kornewald

--~--~---------~--~----~------------~-------~--~----~
 You received this message because you are subscribed to the Google Groups 
"Trac Development" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/trac-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to