Class ProfileInst

  • All Implemented Interfaces:
    Serializable, RightProfile

    public class ProfileInst
    extends BaseRightProfile
    A right profile on a component instance or in an object managed by that component instance. It defines all the users and groups that can access a component instance with some well defined privileges. The privileges in Silverpeas are defined by a set of predefined roles and the given role a profile is related to is indicated by the BaseRightProfile.getName() method. When the profile is about a given resource of a component instance, the right accesses are defined for that resource whose the identifier can be get with the getObjectId() method; by default this method returns ProfiledObjectId.NOTHING if the right profile is on the component instance itself.
    See Also:
    Serialized Form
    • Constructor Detail

      • ProfileInst

        public ProfileInst()
        Constructs an empty right profile on a component instance.
      • ProfileInst

        public ProfileInst​(ProfileInst profile)
        Constructs a right profile on a component instance by copying the specified one.
        Parameters:
        profile - a right profile to copy.
    • Method Detail

      • setComponentFatherId

        public void setComponentFatherId​(int sComponentFatherId)
        Sets the component instance that is related by this profile. By default, this profile is on this component instance until an object identifier is set with the setObjectId(ProfiledObjectId) method with a value other than ProfiledObjectId.NOTHING.
        Parameters:
        sComponentFatherId - the unique identifier of a component instance
      • getComponentFatherId

        public int getComponentFatherId()
        Gets the component instance on which is related this profile. The profile is about the access granted to this component instance with some well defined privileges unless the getObjectId() returns other than ProfiledObjectId.NOTHING.
        Returns:
        the unique identifier of a component instance.
      • getObjectId

        public ProfiledObjectId getObjectId()
        Gets the identifier of the object covered by this profile. In the case the profile only about the component instance referred by the getComponentFatherId() method, then ProfiledObjectId.NOTHING is returned. Such an object can be for example a node.
        Returns:
        the identifier of the object referred by this profile. ProfiledObjectId.NOTHING if none object is covered explicitly by this profile.
      • setObjectId

        public void setObjectId​(ProfiledObjectId objectId)
        This profile is about the specified object and not on the component instance referred by the getComponentFatherId() method. Such an object can be for example a node.
        Parameters:
        objectId - the unique identifier of the object covered by this profile.
      • getParentObjectId

        public ProfiledObjectId getParentObjectId()
        This profile isn't on the actual object but on its one of its parent (in the case the objects are related) whose identifier is returned here.
        Returns:
        the identifier of the object that is really covered by this profile. The actual object get by getObjectId() method inherits the right access defines by this profile.
      • setParentObjectId

        public void setParentObjectId​(ProfiledObjectId parentObjectId)
        This profile isn't on the actual object but on its one of its parent (in the case the objects are related) whose identifier is set here.
        Parameters:
        parentObjectId - the identifier of the object that is really covered by this profile. The actual object get by getObjectId() method inherits the right access defines by this profile.
      • isOnComponentInstance

        public boolean isOnComponentInstance()
        Is the right profile on a component instance?
        Returns:
        true if the profile defines right access of a component instance or false if it defines right access of an object managed by that component instance.