Obtaining current user information
You can obtain the current user when running a Databricks Spark SQL command. Databricks provides built-in functions to retrieve this information.
SELECT current_user(); or SELECT user();
These functions return the username of the user executing the current SQL statement. They are aliases of each other.
SELECT session_user();
This function returns the username associated with the current session. It's important to note that this might be different from current_user() in certain scenarios involving impersonation or temporary user changes within a session
A view can be created to avoid having uses be responsible to providing this if the udf were to be modified to include user information but the source for the view would still be accessible to persons to see.
Two views can be created, one for users to run the decrypt and another for users who do not have access to run the decrypt.