Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with hasProjectPermission #801

Closed
FelixBrunet opened this issue Sep 12, 2023 · 3 comments
Closed

Problem with hasProjectPermission #801

FelixBrunet opened this issue Sep 12, 2023 · 3 comments

Comments

@FelixBrunet
Copy link

Someone has provide a fix here for new version of sonar version, im using 10.2.0.77647

#782

But using this version : 1.15.0-SNAPSHOT

I got this error now:

Caused by: java.lang.NoSuchMethodError: 'boolean org.sonar.server.user.UserSession.hasProjectPermission(java.lang.String, org.sonar.db.project.ProjectDto)'
at com.github.mc1arke.sonarqube.plugin.server.pullrequest.ws.pullrequest.action.ListAction.checkPermission(ListAction.java:108)
at com.github.mc1arke.sonarqube.plugin.server.pullrequest.ws.pullrequest.action.ListAction.handleProjectRequest(ListAction.java:79)
at com.github.mc1arke.sonarqube.plugin.server.pullrequest.ws.pullrequest.action.ProjectWsAction.handle(ProjectWsAction.java:61)
at org.sonar.server.ws.WebServiceEngine.execute(WebServiceEngine.java:111)
at org.sonar.server.platform.web.WebServiceFilter.doFilter(WebServiceFilter.java:84)
at org.sonar.server.platform.web.MasterServletFilter$JavaxFilterAdapter.doFilter(MasterServletFilter.java:227)
at org.sonar.server.platform.web.MasterServletFilter$GodFilterChain.doFilter(MasterServletFilter.java:198)
at org.sonar.server.platform.web.MasterServletFilter$HttpFilterChainAdapter.doFilter(MasterServletFilter.java:241)
at org.sonar.server.platform.web.SonarLintConnectionFilter.doFilter(SonarLintConnectionFilter.java:66)
at org.sonar.server.platform.web.MasterServletFilter$JavaxFilterAdapter.doFilter(MasterServletFilter.java:227)
at org.sonar.server.platform.web.MasterServletFilter$GodFilterChain.doFilter(MasterServletFilter.java:198)
at org.sonar.server.platform.web.MasterServletFilter.doFilter(MasterServletFilter.java:146)
at jdk.internal.reflect.GeneratedMethodAccessor32.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at org.apache.catalina.security.SecurityUtil.lambda$execute$0(SecurityUtil.java:280)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:712)
at java.base/javax.security.auth.Subject.doAsPrivileged(Subject.java:584)
at org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:311)
... 128 common frames omitted

@DiegoGi
Copy link

DiegoGi commented Sep 14, 2023

I have the same problem in version 10.2 of SonarQube running on Windows

@DiegoGi
Copy link

DiegoGi commented Sep 14, 2023

Someone has provide a fix here for new version of sonar version, im using 10.2.0.77647

#782

But using this version : 1.15.0-SNAPSHOT

I got this error now:

Caused by: java.lang.NoSuchMethodError: 'boolean org.sonar.server.user.UserSession.hasProjectPermission(java.lang.String, org.sonar.db.project.ProjectDto)' at com.github.mc1arke.sonarqube.plugin.server.pullrequest.ws.pullrequest.action.ListAction.checkPermission(ListAction.java:108) at com.github.mc1arke.sonarqube.plugin.server.pullrequest.ws.pullrequest.action.ListAction.handleProjectRequest(ListAction.java:79) at com.github.mc1arke.sonarqube.plugin.server.pullrequest.ws.pullrequest.action.ProjectWsAction.handle(ProjectWsAction.java:61) at org.sonar.server.ws.WebServiceEngine.execute(WebServiceEngine.java:111) at org.sonar.server.platform.web.WebServiceFilter.doFilter(WebServiceFilter.java:84) at org.sonar.server.platform.web.MasterServletFilter$JavaxFilterAdapter.doFilter(MasterServletFilter.java:227) at org.sonar.server.platform.web.MasterServletFilter$GodFilterChain.doFilter(MasterServletFilter.java:198) at org.sonar.server.platform.web.MasterServletFilter$HttpFilterChainAdapter.doFilter(MasterServletFilter.java:241) at org.sonar.server.platform.web.SonarLintConnectionFilter.doFilter(SonarLintConnectionFilter.java:66) at org.sonar.server.platform.web.MasterServletFilter$JavaxFilterAdapter.doFilter(MasterServletFilter.java:227) at org.sonar.server.platform.web.MasterServletFilter$GodFilterChain.doFilter(MasterServletFilter.java:198) at org.sonar.server.platform.web.MasterServletFilter.doFilter(MasterServletFilter.java:146) at jdk.internal.reflect.GeneratedMethodAccessor32.invoke(Unknown Source) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:568) at org.apache.catalina.security.SecurityUtil.lambda$execute$0(SecurityUtil.java:280) at java.base/java.security.AccessController.doPrivileged(AccessController.java:712) at java.base/javax.security.auth.Subject.doAsPrivileged(Subject.java:584) at org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:311) ... 128 common frames omitted

This PR fix the problem
#797

mc1arke added a commit that referenced this issue Dec 30, 2023
The `checkProjectPermission` on Sonarqube's UserSession has been
replaced with `hasEntityPermission`, and the `mainBranchProjectUuid`
has been dropped from ComponentDTO, which has required a fix to set the
right UUID as the project UUID for the branch. Additionally, the
`MoreCollectors` map/identity collectors have been dropped from
Sonarqube core, so their references have been replaced with equivalent
`toMap` collectors from the JRE.
mc1arke added a commit that referenced this issue Dec 31, 2023
The `checkProjectPermission` on Sonarqube's UserSession has been
replaced with `hasEntityPermission`, and the `mainBranchProjectUuid`
has been dropped from ComponentDTO, which has required a fix to set the
right UUID as the project UUID for the branch. Additionally, the
`MoreCollectors` map/identity collectors have been dropped from
Sonarqube core, so their references have been replaced with equivalent
`toMap` collectors from the JRE.
@mc1arke mc1arke added the awaiting release Merged but not currently in release version label Jan 1, 2024
@mc1arke
Copy link
Owner

mc1arke commented Jan 1, 2024

Support for Sonarqube 10.2 was released in v1.17.1 of the plugin

@mc1arke mc1arke closed this as completed Jan 1, 2024
@mc1arke mc1arke removed the awaiting release Merged but not currently in release version label Jan 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants