com.silverpeas.accesscontrol
Class ComponentAccessController

java.lang.Object
  extended by com.silverpeas.accesscontrol.AbstractAccessController<String>
      extended by com.silverpeas.accesscontrol.ComponentAccessController
All Implemented Interfaces:
AccessController<String>

@Named
public class ComponentAccessController
extends AbstractAccessController<String>

It controls the access of a user to a given Silverpeas component. A Silverpeas component can be either a Silverpeas application instance (like a KMelia instance for example) or a user personal tool or an administrative tool.

Author:
ehugonnet

Constructor Summary
ComponentAccessController()
           
 
Method Summary
protected  void fillUserRoles(Set<SilverpeasRole> userRoles, AccessControlContext context, String userId, String componentId)
          This method must fill user roles into the given container by taking in account the other parameters.
 boolean isCoWritingEnabled(String componentId)
          Indicates that the rights are set on node as well as the component.
 boolean isFileSharingEnabled(String componentId)
          Indicates if file sharing is enabled on the component instance represented by the given identifier.
 boolean isPublicationSharingEnabled(String componentId)
          Indicates if publication sharing is enabled on the component instance represented by the given identifier.
 boolean isRightOnTopicsEnabled(String componentId)
          Indicates that the rights are set on node as well as the component.
 boolean isUserAuthorized(Set<SilverpeasRole> componentUserRoles)
           
 boolean isUserAuthorized(String userId, String componentId, AccessControlContext context)
          Checks if the specified user may access the specified object.
protected  void setOrganizationController(OrganisationController controller)
          For tests only.
 
Methods inherited from class com.silverpeas.accesscontrol.AbstractAccessController
getUserRoles, isUserAuthorized
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ComponentAccessController

public ComponentAccessController()
Method Detail

setOrganizationController

protected void setOrganizationController(OrganisationController controller)
For tests only.

Parameters:
controller - the controller to set for tests.

isRightOnTopicsEnabled

public boolean isRightOnTopicsEnabled(String componentId)
Indicates that the rights are set on node as well as the component.

Parameters:
componentId -
Returns:

isCoWritingEnabled

public boolean isCoWritingEnabled(String componentId)
Indicates that the rights are set on node as well as the component.

Parameters:
componentId -
Returns:

isFileSharingEnabled

public boolean isFileSharingEnabled(String componentId)
Indicates if file sharing is enabled on the component instance represented by the given identifier.

Parameters:
componentId - the identifier of the component instance.
Returns:
true if file sharing is enabled.

isPublicationSharingEnabled

public boolean isPublicationSharingEnabled(String componentId)
Indicates if publication sharing is enabled on the component instance represented by the given identifier.

Parameters:
componentId - the identifier of the component instance.
Returns:
true if file sharing is enabled.

isUserAuthorized

public boolean isUserAuthorized(String userId,
                                String componentId,
                                AccessControlContext context)
Description copied from interface: AccessController
Checks if the specified user may access the specified object.

Parameters:
userId - the unique identifier of the user.
componentId - the object to be accessed.
context - the context in which the object is accessed.
Returns:
true if access is granted - false otherwise.

isUserAuthorized

public boolean isUserAuthorized(Set<SilverpeasRole> componentUserRoles)

fillUserRoles

protected void fillUserRoles(Set<SilverpeasRole> userRoles,
                             AccessControlContext context,
                             String userId,
                             String componentId)
Description copied from class: AbstractAccessController
This method must fill user roles into the given container by taking in account the other parameters.

Overrides:
fillUserRoles in class AbstractAccessController<String>


Copyright © 2016 Silverpeas. All Rights Reserved.