Facebook
From Sharp Goat, 1 Week ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 42
  1. System.Data.SqlClient.SqlException (0x80131904): User does not have permission to perform this action.
  2. User does not have permission to perform this action.
  3. User does not have permission to perform this action.
  4.    at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
  5.    at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
  6.    at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
  7.    at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
  8.    at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async, Int32 timeout, Boolean asyncWrite)
  9.    at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean asyncWrite)
  10.    at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
  11.    at DotNetNuke.Data.SqlDataProvider.ExecuteScriptInternal(String connectionString, String script)
  12. ClientConnectionId:65c12903-1c60-4ac4-9204-5e4aed76928a
  13. Error Number:15247,State:1,Class:16
  14.  
  15. /*************************************************************/
  16. /*************************************************************/
  17.  
  18. --
  19. --Create Membership roles
  20. --
  21.  
  22. IF ( NOT EXISTS ( SELECT name
  23.                   FROM sys.database_principals
  24.                   WHERE [type] = 'R'
  25.                   AND name = N'aspnet_Membership_FullAccess'  ) )
  26. CREATE ROLE aspnet_Membership_FullAccess
  27.  
  28. IF ( NOT EXISTS ( SELECT name
  29.                   FROM sys.database_principals
  30.                   WHERE [type] = 'R'
  31.                   AND name = N'aspnet_Membership_BasicAccess'  ) )
  32. CREATE ROLE aspnet_Membership_BasicAccess
  33.  
  34. IF ( NOT EXISTS ( SELECT name
  35.                   FROM sys.database_principals
  36.                   WHERE [type] = 'R'
  37.                   AND name = N'aspnet_Membership_ReportingAccess'  ) )
  38. CREATE ROLE aspnet_Membership_ReportingAccess
  39.  
  40. System.Data.SqlClient.SqlException (0x80131904): User or role 'aspnet_Membership_FullAccess' does not exist in this database.
  41. User or role 'aspnet_Membership_FullAccess' does not exist in this database.
  42.    at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
  43.    at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
  44.    at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
  45.    at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
  46.    at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async, Int32 timeout, Boolean asyncWrite)
  47.    at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean asyncWrite)
  48.    at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
  49.    at DotNetNuke.Data.SqlDataProvider.ExecuteScriptInternal(String connectionString, String script)
  50. ClientConnectionId:65c12903-1c60-4ac4-9204-5e4aed76928a
  51. Error Number:15410,State:1,Class:11
  52.  
  53. EXEC sp_addrolemember N'aspnet_Membership_BasicAccess', N'aspnet_Membership_FullAccess'
  54. EXEC sp_addrolemember N'aspnet_Membership_ReportingAccess', N'aspnet_Membership_FullAccess'
  55.  
  56. System.Data.SqlClient.SqlException (0x80131904): Cannot find the user 'aspnet_Membership_BasicAccess', because it does not exist or you do not have permission.
  57. Cannot find the user 'aspnet_Membership_BasicAccess', because it does not exist or you do not have permission.
  58. Cannot find the user 'aspnet_Membership_BasicAccess', because it does not exist or you do not have permission.
  59. Cannot find the user 'aspnet_Membership_BasicAccess', because it does not exist or you do not have permission.
  60. Cannot find the user 'aspnet_Membership_BasicAccess', because it does not exist or you do not have permission.
  61. Cannot find the user 'aspnet_Membership_BasicAccess', because it does not exist or you do not have permission.
  62. Cannot find the user 'aspnet_Membership_BasicAccess', because it does not exist or you do not have permission.
  63. Cannot find the user 'aspnet_Membership_BasicAccess', because it does not exist or you do not have permission.
  64. Cannot find the user 'aspnet_Membership_BasicAccess', because it does not exist or you do not have permission.
  65. Cannot find the user 'aspnet_Membership_BasicAccess', because it does not exist or you do not have permission.
  66. Cannot find the user 'aspnet_Membership_ReportingAccess', because it does not exist or you do not have permission.
  67. Cannot find the user 'aspnet_Membership_ReportingAccess', because it does not exist or you do not have permission.
  68. Cannot find the user 'aspnet_Membership_ReportingAccess', because it does not exist or you do not have permission.
  69. Cannot find the user 'aspnet_Membership_ReportingAccess', because it does not exist or you do not have permission.
  70. Cannot find the user 'aspnet_Membership_ReportingAccess', because it does not exist or you do not have permission.
  71. Cannot find the user 'aspnet_Membership_ReportingAccess', because it does not exist or you do not have permission.
  72. Cannot find the user 'aspnet_Membership_ReportingAccess', because it does not exist or you do not have permission.
  73. Cannot find the user 'aspnet_Membership_ReportingAccess', because it does not exist or you do not have permission.
  74. Cannot find the user 'aspnet_Membership_ReportingAccess', because it does not exist or you do not have permission.
  75. Cannot find the user 'aspnet_Membership_ReportingAccess', because it does not exist or you do not have permission.
  76. Cannot find the user 'aspnet_Membership_FullAccess', because it does not exist or you do not have permission.
  77. Cannot find the user 'aspnet_Membership_FullAccess', because it does not exist or you do not have permission.
  78. Cannot find the user 'aspnet_Membership_FullAccess', because it does not exist or you do not have permission.
  79. Cannot find the user 'aspnet_Membership_FullAccess', because it does not exist or you do not have permission.
  80. Cannot find the user 'aspnet_Membership_FullAccess', because it does not exist or you do not have permission.
  81. Cannot find the user 'aspnet_Membership_FullAccess', because it does not exist or you do not have permission.
  82. Cannot find the user 'aspnet_Membership_FullAccess', because it does not exist or you do not have permission.
  83. Cannot find the user 'aspnet_Membership_ReportingAccess', because it does not exist or you do not have permission.
  84. Cannot find the user 'aspnet_Membership_ReportingAccess', because it does not exist or you do not have permission.
  85. Cannot find the user 'aspnet_Membership_ReportingAccess', because it does not exist or you do not have permission.
  86. Cannot grant, deny, or revoke permissions to sa, dbo, entity owner, information_schema, sys, or yourself.
  87.    at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
  88.    at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
  89.    at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
  90.    at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
  91.    at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async, Int32 timeout, Boolean asyncWrite)
  92.    at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean asyncWrite)
  93.    at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
  94.    at DotNetNuke.Data.SqlDataProvider.ExecuteScriptInternal(String connectionString, String script)
  95. ClientConnectionId:65c12903-1c60-4ac4-9204-5e4aed76928a
  96. Error Number:15151,State:1,Class:16
  97.  
  98. --
  99. --Stored Procedure rights for BasicAcess
  100. --
  101. GRANT EXECUTE ON dbo.aspnet_Membership_GetUserByUserId TO aspnet_Membership_BasicAccess
  102. GRANT EXECUTE ON dbo.aspnet_Membership_GetUserByName TO aspnet_Membership_BasicAccess
  103. GRANT EXECUTE ON dbo.aspnet_Membership_GetUserByEmail TO aspnet_Membership_BasicAccess
  104. GRANT EXECUTE ON dbo.aspnet_Membership_GetPassword TO aspnet_Membership_BasicAccess
  105. GRANT EXECUTE ON dbo.aspnet_Membership_GetPasswordWithFormat TO aspnet_Membership_BasicAccess
  106. GRANT EXECUTE ON dbo.aspnet_Membership_UpdateUserInfo TO aspnet_Membership_BasicAccess
  107. GRANT EXECUTE ON dbo.aspnet_Membership_GetNumberOfUsersOnline TO aspnet_Membership_BasicAccess
  108. GRANT EXECUTE ON dbo.aspnet_CheckSchemaVersion TO aspnet_Membership_BasicAccess
  109. GRANT EXECUTE ON dbo.aspnet_RegisterSchemaVersion TO aspnet_Membership_BasicAccess
  110. GRANT EXECUTE ON dbo.aspnet_UnRegisterSchemaVersion TO aspnet_Membership_BasicAccess
  111.  
  112. --
  113. --Stored Procedure rights for ReportingAccess
  114. --
  115. GRANT EXECUTE ON dbo.aspnet_Membership_GetUserByUserId TO aspnet_Membership_ReportingAccess
  116. GRANT EXECUTE ON dbo.aspnet_Membership_GetUserByName TO aspnet_Membership_ReportingAccess
  117. GRANT EXECUTE ON dbo.aspnet_Membership_GetUserByEmail TO aspnet_Membership_ReportingAccess
  118. GRANT EXECUTE ON dbo.aspnet_Membership_GetAllUsers TO aspnet_Membership_ReportingAccess
  119. GRANT EXECUTE ON dbo.aspnet_Membership_GetNumberOfUsersOnline TO aspnet_Membership_ReportingAccess
  120. GRANT EXECUTE ON dbo.aspnet_Membership_FindUsersByName TO aspnet_Membership_ReportingAccess
  121. GRANT EXECUTE ON dbo.aspnet_Membership_FindUsersByEmail TO aspnet_Membership_ReportingAccess
  122. GRANT EXECUTE ON dbo.aspnet_CheckSchemaVersion TO aspnet_Membership_ReportingAccess
  123. GRANT EXECUTE ON dbo.aspnet_RegisterSchemaVersion TO aspnet_Membership_ReportingAccess
  124. GRANT EXECUTE ON dbo.aspnet_UnRegisterSchemaVersion TO aspnet_Membership_ReportingAccess
  125.  
  126. --
  127. --Additional stored procedure rights for FullAccess
  128. --
  129. GRANT EXECUTE ON dbo.aspnet_Users_DeleteUser TO aspnet_Membership_FullAccess
  130.  
  131. GRANT EXECUTE ON dbo.aspnet_Membership_CreateUser TO aspnet_Membership_FullAccess
  132. GRANT EXECUTE ON dbo.aspnet_Membership_SetPassword TO aspnet_Membership_FullAccess
  133. GRANT EXECUTE ON dbo.aspnet_Membership_ResetPassword TO aspnet_Membership_FullAccess
  134. GRANT EXECUTE ON dbo.aspnet_Membership_UpdateUser TO aspnet_Membership_FullAccess
  135. GRANT EXECUTE ON dbo.aspnet_Membership_ChangePasswordQuestionAndAnswer TO aspnet_Membership_FullAccess
  136. GRANT EXECUTE ON dbo.aspnet_Membership_UnlockUser TO aspnet_Membership_FullAccess
  137.  
  138. --
  139. --View rights
  140. --
  141. GRANT SELECT ON dbo.vw_aspnet_Applications TO aspnet_Membership_ReportingAccess
  142. GRANT SELECT ON dbo.vw_aspnet_Users TO aspnet_Membership_ReportingAccess
  143.  
  144. GRANT SELECT ON dbo.vw_aspnet_MembershipUsers TO aspnet_Membership_ReportingAccess
  145.  
  146. /*************************************************************/
  147. /*************************************************************/
  148. /*************************************************************/
  149. /*************************************************************/
  150.  
  151. DECLARE @command nvarchar(4000)
  152. SET @command = 'REVOKE EXECUTE ON [dbo].aspnet_RegisterSchemaVersion FROM ' + QUOTENAME(user)
  153. EXECUTE (@command)
  154.  
  155.  
  156.