Symptoms
When we run a list view that executes List Method we receive an error stating:
User does not have permission to perform this action.
Diagnoses
If the flag On Different SQL Server is set to true, the stored procedure sp_addlinkedserver has to be run to execute the query on the remote SQL Server.
When a user executes a SQL Service SmartObject method that uses a Linked Server to a remote LOB database server, if the Linked Server does not exist K2 will attempt to execute the sp_addlinkedserver system stored procedure as the K2 service account to create it. Quite often the K2 service account does not have the permissions to execute this stored procedure and list method fails with following error:
"User does not have permission to perform this action"
The minimum permissions required by the K2 service account to execute the sp_addlinkedserver system stored procedure are:
ALTER ANY LINKED SERVER
ALTER ANY LOGIN
BUT the user could also temporarily give the SQL Login for the K2 service account the SysAdmin role, run the list method so the linked server gets created then remove the SysAdmin role.
For information on crating Linked Servers manually, please see the MSDN topic: Create Linked Servers (SQL Server Database Engine)
Resolution
K2 service account didn't have the right permission and it couldn't create new linked servers by executing (sp_addlinkedserve), giving the service account the right permissions on the SQL server resolved the issue.
http://help.k2.com/onlinehelp/k2blackpearl/icg/4.6.4/webframe.html_before_serviceaccounts.html
we encountered another issue when we try to execute any SMO method:(Named Pipes provider: Could not open a connection to SQL Server), modified the service instance and set the value of "Use Native SQL Execution" to false resolved the issue.
SQL Server Service - Service Instance Configuration:
https://help.k2.com/onlinehelp/k2blackpearl/userguide/4.6.6/webframe.html_sic02.html