Class QueryContext
java.lang.Object
com.denodo.common.custom.elements.QueryContext
Class that provides methods to obtain:
- The user name that executes the query
- The set of roles granted to this user
- The Denodo database to which the user is connected when executing the query that uses this function
To obtain an instance of this class, invoke the method
CustomElementsUtil.getQueryContext()
- Since:
- 6.0 Update 20160429
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the name of the database where the query is executedReturns the name of the user who executes the queryReturns the names of all the roles granted directly or indirectly to the user who executes the query.
Roles indirectly granted to the user are roles that have been granted to one of the roles of the user and not the user itself.
-
Constructor Details
-
QueryContext
-
-
Method Details
-
getCurrentUserRoles
Returns the names of all the roles granted directly or indirectly to the user who executes the query.
For example, if the user that executes this function is granted
Roles indirectly granted to the user are roles that have been granted to one of the roles of the user and not the user itself.role1,role2is granted torole1androle3is granted torole2, this function will return a set withrole1,role2androle3. TheSetis not sorted, so the order is not guaranteed.- Returns:
- the names of all the roles assigned to the user who executes the query. An empty
Setif the user does not have any role assigned.
-
getCurrentDatabaseName
Returns the name of the database where the query is executed- Returns:
- the name of the database where the query is executed
-
getCurrentUserName
Returns the name of the user who executes the query- Returns:
- the name of the user who executes the query
-