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 @@
Authors: Julian Hyde, Barry Klawans
-Version: 0.9.4 (beta)
+Version: 0.9.5 (beta)
Revision: $Id$
(log)
-Last modified: December 18th, 2007.
NamedList<Catalog> getCatalogs()
Schema getSchema()
void setLocale(Locale locale)
Locale getLocale()
void setRoleName(String roleName)
String getRoleName()
PreparedOlapStatement prepareOlapStatement(String mdx)
MdxParserFactory getParserFactory()
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 @@
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.
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; + } +