SQL User Impersonation with K2
SQL Server impersonation, or context switching, is a means to allow K2 to assume the permissions of a given user or login when executing your SQL queries. Under the covers this functionality makes use of K2 Pass-through Authentication.
To enable SQL Server impersonation you first need to register the SQL server service instance, by right-clicking on the ‘SQL Server Service’ in the ServiceObject Explorer, and then select ‘Impersonate as your Authentication Mode, as indicated in the screenshots below:
K2 Automated Testing Software
BenchQA allows full test automation of K2, including fully automated K2 SmartForms and K2 Workflow testing. It promotes test driven development for K2 and ensures continued quality assurance for K2 solutions. Easily apply changes to test cases to accommodate changes to K2 apps and ensure all apps are regression tested to avoid defects and assure continuous quality.
For this functionality to work you then need to create a database user in the specific database, and then grant the K2 Service Account impersonation rights on the login you created. the following SQL accomplishes this.
Note that although you can grant login’s to the database on a windows group level, impersonation rights need to be giving for each specific user, and will not work on a group level.