Class BaseSubject

  • All Implemented Interfaces:
    Serializable, Subject

    public class BaseSubject
    extends Object
    implements Subject
    Default implementation of a Subject. Usable by both wicket applications and other type of applications like soap.
    Author:
    marrink
    See Also:
    Subject, Serialized Form
    • Constructor Detail

      • BaseSubject

        public BaseSubject()
    • Method Detail

      • isReadOnly

        public final boolean isReadOnly()
        Description copied from interface: Subject
        When set it is no longer possible to change the set of principals of this subject.
        Specified by:
        isReadOnly in interface Subject
        Returns:
        true if this Subject is readonly, false otherwise
        See Also:
        Subject.isReadOnly()
      • setReadOnly

        public final void setReadOnly()
        Description copied from interface: Subject
        Mark this subject as readonly. preventing principals to be added or removed. Note this method is always called on a subject after it has been handed over to the security layer.
        Specified by:
        setReadOnly in interface Subject
        See Also:
        Subject.setReadOnly()
      • addPrincipal

        public final boolean addPrincipal​(Principal principal)
        Adds a new principal to this subject.
        Parameters:
        principal -
        Returns:
        true if the principal was added, false if it wasn't for instance because the subject is readonly.