Class PRestriction

java.lang.Object
com.portal.bas.PRestriction
All Implemented Interfaces:
Serializable, Cloneable
Direct Known Subclasses:
PSettableRestriction

public class PRestriction extends Object implements Serializable, Cloneable
PRestriction represents how a given field in an flist might have its value restricted when used with a specific opcode. Not only might the field be read or write only, but it may be an Enumeration (restricted to specific legal values), have minimum or maximum values, or the user may only be allowed to see part of it.
See Also:
  • Field Details

  • Method Details

    • getRestriction

      public static PRestriction getRestriction(String type)
      Call this method handing in one of the public PERM_* definitions above. You will get the PRestriction for that permission setting if one is defined for the currently logged in user.
      If no permission string is defined for the requested type, a PRestriction object with VIEWABLE_NO / CHANGABLE_NO will be returned.
      Returns:
      The PRestriction object for the currently logged in user
    • getRestrictionExists

      public static PRestriction getRestrictionExists(String type)
      Call this method handing in one of the public PERM_* definitions above. You will get the PRestriction for that permission setting if one is defined for the currently logged in user.
      If no permission string is defined for the requested type, null will be returned.
      Returns:
      The PRestriction object for the currently logged in user; null if the given permission is not defined.
    • getViewRestriction

      public int getViewRestriction()
      Gets the viewable level. The value returned is yes, no, or yes-masked.
      Returns:
      VIEWABLE_NO, VIEWABLE_YES, or VIEWABLE_MASKED.
    • getChangeRestriction

      public int getChangeRestriction()
      Gets the permitted changeability. The returned permissions include yes, no, yes-within a range, or yes-one of a set of discrete values.
      Returns:
      CHANGABLE_NO, CHANGABLE_YES, CHANGABLE_RANGED, or CHANGABLE_DISCRETE.
    • getViewMask

      public String getViewMask()
      Gets the view mask, if any is required. Can be null (no mask).

      The mask string should be compared to the data character by character. Each space in the mask represents a visible character. Each non-space hides the character and should cause display of that non-space character instead. An exception to this rule is the tilde (~) character, which should hide the underlying character and not display anything in its place, essentially moving all further characters one space to the left.

      If the mask string is shorter than the target string, the mask string should be extended by spaces, for example, to show the rest of the target string.

      Returns:
      The String to use for masking the view.
    • getRangeMinimum

      public Number getRangeMinimum()
      Gets the minimum value to use for a range of indiscrete values.
      Returns:
      The minimum indiscrete value.
    • getRangeMaximum

      public Number getRangeMaximum()
      Gets the maximum value to use for a range of indiscrete values.
      Returns:
      The maximum indiscrete value.
    • getDiscreteValues

      public Object[] getDiscreteValues()
      Gets an array of allowed discrete values for the field. The object type matches the field's value type.
      Returns:
      An array of objects, each an allowed discrete value.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getValidApp

      public static Vector getValidApp(String appname)
      To get valid App for this user
      Parameters:
      appname -
      Returns: