Class RestrictionManager

java.lang.Object
com.portal.pfc.infranet.restriction.RestrictionManager
All Implemented Interfaces:
RestrictionConstants

public class RestrictionManager extends Object implements RestrictionConstants
Single point of entry for retrieving permissions for a user logged into Portal. You should retrieve the RestrictionManager instance for your given PortalContext, and use it to retrieve individual permission settings.
  • Method Details

    • getInstance

      public static RestrictionManager getInstance(PortalContext ctx)
      Retrieves the RestrictionManager instance, which can be used to retrieve individual permission settings for the user logged into Portal for the given connection.

      Note that a separate RestrictionManager will be retrieved for each PortalContext passed in - this means this class will handle the case where you are connecting to multiple Portal instances (possibly as different users).
      Parameters:
      ctx - The PortalContext representing your Portal connection
    • getRestriction

      public Restriction getRestriction(String type, String application)
      Retrieves the Restriction object representing the passed in permission string. The permission string passed in can be one publicly defined in RestrictionConstants or your own custom string that you have entered for your users. This will return the Restriction 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 Restriction object with VIEWABLE_NO / CHANGABLE_NO will be returned.
      Parameters:
      type - The permission string to retrieve (i.e. /accounttool/billnow)
      application - Not currently used, so may be null. In the future this will be used for Role-based permissions so the caller will need to specify the name of the application they are retrieving this permission for (i.e. Customer Center, Pricing Center, etc.).
      Returns:
      The Restriction object for the currently logged in user
    • isFeatureDisabled

      public boolean isFeatureDisabled(String featureName, PortalContext ctx, String appName)
      This method can be used to know whether the Feature is disabled or enabled in the server
      Parameters:
      ctx - PortalContext
      appName - String
      FeatureName - String
      Returns:
      boolean false
    • getRestrictionExists

      public Restriction getRestrictionExists(String type, String application)
      Retrieves the Restriction object representing the passed in permission string. The permission string passed in can be one publicly defined in RestrictionConstants or your own custom string that you have entered for your users. This will return the Restriction 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.
      Parameters:
      type - The permission string to retrieve (i.e. /accounttool/billnow)
      application - Not currently used, so may be null. In the future this will be used for Role-based permissions so the caller will need to specify the name of the application they are retrieving this permission for (i.e. Customer Center, Pricing Center, etc.).
      Returns:
      The Restriction object for the currently logged in user; null if the given permission is not defined.