Package wt.org

Class WTPrincipal

java.lang.Object
wt.fc._WTObject
wt.fc.WTObject
wt.fc._Item
wt.fc.Item
wt.org._WTPrincipal
wt.org.WTPrincipal
All Implemented Interfaces:
Externalizable, Serializable, Principal, wt.access._AccessControlled, wt.access._PolicyAccessControlled, wt.access._SecurityLabeled, AccessControlled, wt.access.PolicyAccessControlled, SecurityLabeled, wt.admin._DomainAdministered, DomainAdministered, wt.fc._NetFactor, wt.fc._ObjectMappable, wt.fc._Persistable, wt.fc.adminlock._AdministrativelyLockable, AdministrativelyLockable, wt.fc.BusinessInformation, NetFactor, ObjectMappable, Persistable, wt.federation._FederatedLinkHolder, wt.federation._RemotelyLinkable, wt.federation.FederatedLinkHolder, wt.federation.RemotelyLinkable, DisplayIdentification, wt.recent.RecentlyVisited, wt.type._TypeManaged, wt.type.TypeManaged, wt.ufid._Federatable, wt.ufid.Federatable
Direct Known Subclasses:
wt.org._WTGroup, wt.org._WTUser

@GenAsPersistable(superClass=Item.class,interfaces={wt.fc.BusinessInformation.class,wt.ufid.Federatable.class,java.security.Principal.class,wt.recent.RecentlyVisited.class,wt.type.TypeManaged.class},versions={1585326919551007717L,6390037358360073537L,1644197448890091130L,-969545486651487794L},properties={@GeneratedProperty(name="name",type=java.lang.String.class,javaDoc="Name of the principal (user, group, or organization). This is a required attribute.",accessors=@PropertyAccessors(setExceptions={UserNotFoundException.class,WTPropertyVetoException.class}),constraints=@PropertyConstraints(required=true)),@GeneratedProperty(name="disabled",type=boolean.class,initialValue="false",accessors=@PropertyAccessors(setExceptions={WTException.class,WTPropertyVetoException.class})),@GeneratedProperty(name="dn",type=java.lang.String.class,accessors=@PropertyAccessors(setExceptions={}),columnProperties=@ColumnProperties(persistent=false)),@GeneratedProperty(name="repository",type=java.lang.String.class,accessors=@PropertyAccessors(setExceptions={}),columnProperties=@ColumnProperties(persistent=false)),@GeneratedProperty(name="repairNeeded",type=boolean.class,initialValue="false",accessors=@PropertyAccessors(setExceptions={})),@GeneratedProperty(name="inflated",type=boolean.class,initialValue="false",accessors=@PropertyAccessors(getAccess=PROTECTED,setExceptions={}),columnProperties=@ColumnProperties(persistent=false)),@GeneratedProperty(name="additionalAttributes",type=java.util.HashMap.class,accessors=@PropertyAccessors(getAccess=PRIVATE,setExceptions={}),columnProperties=@ColumnProperties(persistent=false),javaDoc="The attribute holds a map of all additional attributes (not known previously to Windchill and its values."),@GeneratedProperty(name="attributes",type=wt.org.AttributeHolder.class,accessors=@PropertyAccessors(setExceptions={}),columnProperties=@ColumnProperties(persistent=false)),@GeneratedProperty(name="internal",type=boolean.class,initialValue="false"),@GeneratedProperty(name="status",type=PrincipalStatus.class,javaDoc="The attribute holds the status of a principal object"),@GeneratedProperty(name="remoteDirectoryServerId",type=java.lang.String.class,accessors=@PropertyAccessors(getAccess=PRIVATE,setExceptions={}),constraints=@PropertyConstraints(upperLimit=4000),javaDoc="The attribute holds the attribute value mapped to remoteDirectoryServerId ")}) public abstract class WTPrincipal extends wt.org._WTPrincipal
Abstract class that represents a user or a group of users.

Supported API: true

Extendable: false
See Also:
  • Method Details

    • getName

      public String getName()
      Gets the value of the attribute: NAME. Name of the principal (user, group, or organization). This is a required attribute.

      Supported API: true
      Specified by:
      getName in interface Principal
      Overrides:
      getName in class wt.org._WTPrincipal
      Returns:
      String
    • equals

      public boolean equals(Object obj)
      Determines if the current principal is equal to the one passed as argument. Two principals are considered equal if they have the same name.

      Supported API: true
      Specified by:
      equals in interface Principal
      Overrides:
      equals in class wt.fc._WTObject
      Parameters:
      obj -
      Returns:
      boolean
    • getOrganization

      public WTOrganization getOrganization() throws WTException
      Returns the organization associated to the principal, if the organization is found and the session user has access to the organization If the organization is not found it return null. If the organization is found, but the session user does not have access to the organization, this method throws an AccessControlException

      Supported API: true
      Returns:
      WTOrganization
      Throws:
      WTException
    • cloneAsInflated

      public WTPrincipal cloneAsInflated() throws WTException
      Creates a clone and specifically sets the inflated flag set to TRUE so it won't auto-inflate subsequently when calling getters.

      Supported API: true
      Returns:
      WTPrincipal - Cloned principal
      Throws:
      WTException
    • getUniqueDisplayIdentifier

      public String getUniqueDisplayIdentifier() throws WTException
      Returns a unique, display-friendly identifier for the principal. Labels and internal representations are localized using session locale.

      The value returned is determined by the type of principal:

      If the session user does not have access to the principal, the wt.access.accessResource.SECURED_INFORMATION message is returned instead.

      Supported API: true
      Returns:
      String - Unique display identifier generated based on the above specifications
      Throws:
      WTException
    • getPrincipalDisplayIdentifier

      public final String getPrincipalDisplayIdentifier() throws WTException
      Returns a display-friendly name/identifier for the principal. Labels and internal representations are localized using session locale.

      While there are many attributes needed to make a principal uniquely identifiable, all those attributes are not included in the identifier returned by this API. If indeed a unique display identity is what is required, use getUniqueDisplayIdentifier()

      The name returned is determined by the type of principal:
      • Pseudo-roles ALL or OWNER: Returns the localized value corresponding to these names
        For example: "All" or "Owner"
      • User: Returns the user's full name
      • External/user-defined group: Returns the group's name. In the case of "ORG ADMIN" group, the localized value for "Organization Administrator" is returned
      • Internal/System group: For role group, the localized name of the role is returned (for example "Team Members", "Guest", etc.). For internal organization group, the name of the organization is returned. For other system groups, the group's name is returned as-is
      • Role Principal: Returns the localized name of the role principal. If this role principal is for an internal organization group, the name of the organization is returned instead.
      • Organization: Returns the organization's name
      • All other cases: Returns the principal's name
      In the case where the returned identifier involves the principal's organization, if the session user does not have access to that organization, the wt.access.accessResource.SECURED_INFORMATION message is displayed in the place of organization's name.

      Supported API: true
      Returns:
      String - Unique display identifier generated based on the above specifications
      Throws:
      WTException