com.crystaldecisions.sdk.occa.infostore
Interface ISecurityInfo


public interface ISecurityInfo

The ISecurityInfo interface allows you to set the security roles, rights, and limits on an object for a specific user or group. Roles are predefined set of object rights that are designed to cover the most common cases of security access. It is recommended that you start by using roles, and then apply more granular rights if necessary. Specifically, rights permit a user or group to perform specific actions on an object; limits restrict the number of instances for each object, user, or group that are allowed on the system. Users or groups that are given specific object rights and limits are called object principals.

BusinessObjects Enterprise uses object security, which means that roles, rights, and limits are set for each InfoObject in the system and not for each principal. For example, all folders have a set of available rights that the system makes available to them. You can use a report's SecurityInfo object to determine which of these rights you want to give to a particular user or group. Specifically, you can use the getKnownRights method to select the rights that you want to grant or deny to a principal, and then add these rights to the principal's SecurityRights collection.

See Also:
ISecurityRights

Method Summary
 boolean checkCustomRight(int RightID, java.lang.String kind)
           Returns true if the specified custom right is defined for the current user.
 boolean[] checkCustomRights(int[] rights, java.lang.String[] kinds, boolean useCache)
           Returns custom rights from the CMS in a single batch.Using this method is the easiest way to determine the current user's net rights.
 boolean checkRight(int RightID)
           Returns true if the specified right is permitted for the current user.
 boolean[] checkRights(int[] rights)
           Returns multiple rights from the CMS in a single batch.
 boolean[] checkRights(int[] rights, boolean useCache)
           Sets whether rights that have been cached will be used.
 boolean checkSystemRight(int RightID)
           Returns true if the specified system right is defined for the current user.
 boolean[] checkSystemRights(int[] rights, boolean useCache)
           Returns multiple system rights from the CMS in a single batch.
 IObjectPrincipal getAnyPrincipal(int PrincipalID)
           Returns the effective rights and limits for any principal, even if the principal does not have explicit rights to the object.
 IRightID[] getKnownLimits()
           Returns a collection of limits that this object supports.
 IRightID[] getKnownRights()
           Returns a collection of rights that this object supports.
 IObjectPrincipals getObjectPrincipals()
           Returns the collection of principals that have rights on the object.
 

Method Detail

checkRight

public boolean checkRight(int RightID)
                   throws SDKException

Returns true if the specified right is permitted for the current user.

Parameters:
RightID - The right ID of the right to be checked.
Returns:
A boolean indicating whether the specified right is permitted for this object. If the value is true the specified right is permitted for this object, otherwise false.
Throws:
SDKException - This is thrown if the process is unsuccessful.

checkSystemRight

public boolean checkSystemRight(int RightID)
                         throws SDKException

Returns true if the specified system right is defined for the current user.

Parameters:
RightID - The right ID of the right to be checked.
Returns:
A boolean indicating whether the specified right is permitted for this object. If the value is true the specified right is permitted for this object, otherwise false.
Throws:
SDKException - This is thrown if the process is unsuccessful.

checkCustomRight

public boolean checkCustomRight(int RightID,
                                java.lang.String kind)
                         throws SDKException

Returns true if the specified custom right is defined for the current user.

Parameters:
RightID - The right ID of the right to be checked.
kind - The kind of the right to be checked. The kind represents the InfoObject type.
Returns:
A boolean indicating whether the specified right is permitted for this object. If the value is true the specified right is permitted for this object, otherwise false.
Throws:
SDKException - This is thrown if the process is unsuccessful.

checkRights

public boolean[] checkRights(int[] rights)
                      throws SDKException

Returns multiple rights from the CMS in a single batch. Using this method is the easiest way to determine the current user's net rights. This method is particularly useful when you are working with inheritance. For example, if the right to schedule a report has been explicitly granted to the current user, but that user is also set to inherit rights from a parent folder on which the right has been denied, the user will not be permitted to schedule the report.

Parameters:
rights - A int[] array specifying right ids.
Returns:
A boolean array indicating whether specified rights are permitted for this object. If the value is true the specified rights are permitted for this object, otherwise false.
Throws:
SDKException - This is thrown if the process is unsuccessful.

checkRights

public boolean[] checkRights(int[] rights,
                             boolean useCache)
                      throws SDKException

Sets whether rights that have been cached will be used. When set to false, rights will be retrieved from the server regardless of whether they exist in the cache. When set to true if rights have been cached they will be used, and if they have not been cached they will be retrieved from the server. Using this method is the easiest way to determine the current user's net rights. This method is particularly useful when you are working with inheritance. For example, if the right to schedule a report has been explicitly granted to the current user, but that user is also set to inherit rights from a parent folder on which the right has been denied, the user will not be permitted to schedule the report.

Parameters:
rights - A int[] array specifying right ids.
useCache - This value should be set to false to retrieve rights from the server rather than using cached rights.
Returns:
A boolean array indicating whether specified rights are permitted for this object. If the value is true the specified rights are permitted for this object, otherwise false.
Throws:
SDKException - This is thrown if the process is unsuccessful.

checkSystemRights

public boolean[] checkSystemRights(int[] rights,
                                   boolean useCache)
                            throws SDKException

Returns multiple system rights from the CMS in a single batch. Using this method is the easiest way to determine the current user's net rights. This method is particularly useful when you are working with inheritance. For example, if the right to schedule a report has been explicitly granted to the current user, but that user is also set to inherit rights from a parent folder on which the right has been denied, the user will not be permitted to schedule the report.

Parameters:
rights - A int[] array specifying system right ids.
useCache - This value should be set to false to retrieve rights from the server rather than using cached rights.
Returns:
A boolean array indicating whether specified system rights are permitted for this object. If the value is true the specified rights are permitted for this object, otherwise false.
Throws:
SDKException - This is thrown if the process is unsuccessful.

checkCustomRights

public boolean[] checkCustomRights(int[] rights,
                                   java.lang.String[] kinds,
                                   boolean useCache)
                            throws SDKException

Returns custom rights from the CMS in a single batch.Using this method is the easiest way to determine the current user's net rights. This method is particularly useful when you are working with inheritance. For example, if the right to schedule a report has been explicitly granted to the current user, but that user is also set to inherit rights from a parent folder on which the right has been denied, the user will not be permitted to schedule the report.

Parameters:
rights - A int[] array specifying system right ids.
kinds - A String[] array specifying the InfoObject types.
useCache - This value should be set to false to retrieve rights from the server rather than using cached rights.
Returns:
A boolean array indicating whether specified system rights are permitted for this object. If the value is true the specified rights are permitted for this object, otherwise false.
SDKException

getKnownRights

public IRightID[] getKnownRights()
                          throws SDKException

Returns a collection of rights that this object supports.

Returns:
An array of IRightID objects specifying the rights this object supports.
Throws:
SDKException - This is thrown if the process is unsuccessful.

getObjectPrincipals

public IObjectPrincipals getObjectPrincipals()
                                      throws SDKException

Returns the collection of principals that have rights on the object.

Returns:
The IObjectPrincipals collection that contains the principals that have rights on this object.
Throws:
SDKException - This is thrown if the process is unsuccessful.

getAnyPrincipal

public IObjectPrincipal getAnyPrincipal(int PrincipalID)
                                 throws SDKException

Returns the effective rights and limits for any principal, even if the principal does not have explicit rights to the object.

Parameters:
PrincipalID - The ID of the principal as an int.
Returns:
The read-only IObjectPrincipal object containing the effective rights for the specified principal.
Throws:
SDKException - This is thrown if the process is unsuccessful.

getKnownLimits

public IRightID[] getKnownLimits()
                          throws SDKException

Returns a collection of limits that this object supports.

Returns:
An array of IRightID objects specifying the limits this object supports.
Throws:
SDKException - This is thrown if the process is unsuccessful.