diff --git a/doc/olap4j_fs.html b/doc/olap4j_fs.html index dbc364a..1d8b255 100644 --- a/doc/olap4j_fs.html +++ b/doc/olap4j_fs.html @@ -79,10 +79,10 @@

olap4j Specification

Authors: Julian Hyde, Barry Klawans
-Version: 0.9.4 (beta)
+Version: 0.9.5 (beta)
Revision: $Id$ (log)
-Last modified: December 18th, 2007.

+Last modified: March 5th, 2008.


Contents

@@ -643,6 +643,13 @@

2.2.1. Connection pooling

Methods:

2.2.3. The OlapWrapper interface

@@ -1204,7 +1211,8 @@

2.7.1. Access control

for access control depend on the provider, and this specification does not say what those rules should be. But this specification requires that the API methods must behave consistently with the server's access control policy.

-

For example, in mondrian, users belong to roles, and roles may be granted or + +

For example, in mondrian, users belong to roles, and roles may be granted or denied access to cubes, hierarchies, or members within hierarchies. Suppose that user Fred belongs to the "Sales Manager" role, which does not have access to the [Nation] @@ -1215,6 +1223,12 @@

2.7.1. Access control

OlapDatabaseMetaData.getLevels() methods will omit the Nation level from the list of levels they return.

+

In olap4j, you can set a connection's role at connect time using the +Role connect string property, or you can call the +OlapConnection.setRole(String roleName) method at any point +during the lifecycle of the connection. Setting the role name to +null reverts to the default access-control context.

+

2.7.2. Metadata objects

The following diagram shows the metadata objects in an olap4j schema.

diff --git a/src/org/olap4j/OlapConnection.java b/src/org/olap4j/OlapConnection.java index 07fd733..25cbeb3 100644 --- a/src/org/olap4j/OlapConnection.java +++ b/src/org/olap4j/OlapConnection.java @@ -96,6 +96,23 @@ public interface OlapConnection extends Connection, OlapWrapper { * @return locale of this connection */ Locale getLocale(); + + /** + * Sets the name of the role in which this connection executes queries. If + * the name of the role is null, the connection reverts to the default + * access control context. + * + * @param roleName Name of role + * @throws OlapException if role name is invalid + */ + void setRoleName(String roleName) throws OlapException; + + /** + * Returns the name of the role in which this connection executes queries. + * + * @return name of the role in which this connection executes queries + */ + String getRoleName(); } // End OlapConnection.java diff --git a/src/org/olap4j/driver/xmla/XmlaOlap4jConnection.java b/src/org/olap4j/driver/xmla/XmlaOlap4jConnection.java index 5bde8e8..f132d1e 100644 --- a/src/org/olap4j/driver/xmla/XmlaOlap4jConnection.java +++ b/src/org/olap4j/driver/xmla/XmlaOlap4jConnection.java @@ -67,6 +67,7 @@ abstract class XmlaOlap4jConnection implements OlapConnection { private Locale locale; private String catalogName; private static final boolean DEBUG = true; + private String roleName; /** * Creates an Olap4j connection an XML/A provider. @@ -391,6 +392,14 @@ public Locale getLocale() { return locale; } + public void setRoleName(String roleName) throws OlapException { + this.roleName = roleName; + } + + public String getRoleName() { + return roleName; + } + void populateList( List list, Context context,