com.atlassian.jira.portal
Class DefaultPortletAccessManager

java.lang.Object
  extended by com.atlassian.jira.portal.DefaultPortletAccessManager
All Implemented Interfaces:
PortletAccessManager

public class DefaultPortletAccessManager
extends Object
implements PortletAccessManager

An implementation of PortletAccessManager

Since:
v3.13

Constructor Summary
DefaultPortletAccessManager(PermissionManager permissionManager, com.atlassian.plugin.PluginAccessor pluginAccessor)
           
 
Method Summary
 boolean canUserSeePortlet(User user, Portlet portlet)
          This returns true if the specified user is allowed to see the passed Portlet
 boolean canUserSeePortlet(User user, String portletKey)
          This returns true if the specified user is allowed to see the Portlet represented by the given portletKey
 Collection getAllPortlets()
          Return all the portlets available on the system.
 Portlet getPortlet(String portletKey)
          This returns a Portlet based on portletKey
 Portlet getPortlet(User user, String portletKey)
          Called to return a Portlet that can be seen by the User and which has the key of portletKey
 Collection getVisiblePortlets(User user)
          This returns all Portlet's that a user can see
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultPortletAccessManager

public DefaultPortletAccessManager(PermissionManager permissionManager,
                                   com.atlassian.plugin.PluginAccessor pluginAccessor)
Method Detail

getPortlet

public Portlet getPortlet(User user,
                          String portletKey)
Description copied from interface: PortletAccessManager
Called to return a Portlet that can be seen by the User and which has the key of portletKey

Specified by:
getPortlet in interface PortletAccessManager
Parameters:
user - the user context in which to return the Portlet
portletKey - the key of the Portlet
Returns:
a Portlet if the user can see it or null if they dont have permission or the portletKey is invalid

getPortlet

public Portlet getPortlet(String portletKey)
Description copied from interface: PortletAccessManager
This returns a Portlet based on portletKey

Specified by:
getPortlet in interface PortletAccessManager
Parameters:
portletKey - the key of the Portlet
Returns:
a Portlet or null if one can be found with the specified key

getAllPortlets

public Collection getAllPortlets()
Description copied from interface: PortletAccessManager
Return all the portlets available on the system.

Specified by:
getAllPortlets in interface PortletAccessManager
Returns:
a collection of all the portlets available on the system.

getVisiblePortlets

public Collection getVisiblePortlets(User user)
Description copied from interface: PortletAccessManager
This returns all Portlet's that a user can see

Specified by:
getVisiblePortlets in interface PortletAccessManager
Parameters:
user - the User in play
Returns:
a non null Collection of Portlet objects

canUserSeePortlet

public boolean canUserSeePortlet(User user,
                                 String portletKey)
Description copied from interface: PortletAccessManager
This returns true if the specified user is allowed to see the Portlet represented by the given portletKey

Specified by:
canUserSeePortlet in interface PortletAccessManager
Parameters:
user - the user to test.
portletKey - the key of the Portlet
Returns:
true if the user has permission to view the Portlet

canUserSeePortlet

public boolean canUserSeePortlet(User user,
                                 Portlet portlet)
Description copied from interface: PortletAccessManager
This returns true if the specified user is allowed to see the passed Portlet

Specified by:
canUserSeePortlet in interface PortletAccessManager
Parameters:
user - the user to test.
portlet - the portlet the check
Returns:
true if the user has permission to view the Portlet


Copyright © 2002-2009 Atlassian. All Rights Reserved.