Class RestrictionManager
java.lang.Object
com.portal.pfc.infranet.restriction.RestrictionManager
- All Implemented Interfaces:
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.
-
Field Summary
Fields inherited from interface com.portal.pfc.infranet.restriction.RestrictionConstants
CHANGABLE_DISCRETE, CHANGABLE_NDISCRETE, CHANGABLE_NO, CHANGABLE_RANGED, CHANGABLE_YES, INF_NONE, INF_READ_ONLY, INF_READ_WRITE, INF_WRITE_ONLY, VIEWABLE_MASKED, VIEWABLE_NO, VIEWABLE_YES, XML_NONE, XML_READ_ONLY, XML_READ_WRITE, XML_WRITE_ONLY
-
Method Summary
Modifier and TypeMethodDescriptionstatic 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).getRestriction
(String type, String application) Retrieves the Restriction object representing the passed in permission string.getRestrictionExists
(String type, String application) Retrieves the Restriction object representing the passed in permission string.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
-
Method Details
-
getInstance
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
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
This method can be used to know whether the Feature is disabled or enabled in the server- Parameters:
ctx
- PortalContextappName
- StringFeatureName
- String- Returns:
- boolean false
-
getRestrictionExists
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.
-