from zope.interface import Attribute
from zope.interface import Interface
from zope.interface.interfaces import IObjectEvent


class IPloneintranetUserprofileLayer(Interface):
    """Marker interface that defines a Zope 3 browser layer."""


class IMemberGroup(Interface):
    """
    Marker interface for non-SiteRoot objects which define local
    membership. Such objects must provide a `members` property.
    """

    def members():
        """Returns a list of member ids"""


class IFunctionalPrincipal(Interface):
    """Marker interface that identifies principals that are there because of
    some functional purpose but regular users do not want to see them in the UI
    """


class INeverDeletedMemberGroup(IMemberGroup):
    """
    Marker interface for member groups that may not be deleted,
    like the 'intranet' group which lives in content space but
    is assumed to always be defined at the code level.
    """


class IMemberGroupMembershipChangedEvent(IObjectEvent):
    """
    Principals were added to, or removed from, a workgroup.
    """

    old_membership = Attribute("principal ids before the change was made")
    new_membership = Attribute("principal ids now this change has been made")
