-
Notifications
You must be signed in to change notification settings - Fork 97
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
In a Grails multi-project, there are errors when the User/Role domain classes are in a separate plugin subproject #110
Comments
I have an idea of what the cause would be and was wondering if you'd like to test out my theory? I believe the issue may be that the plugin is dependent upon the I believe both of the dependencies on All security related domain classes ( The endpoints, including those in your plugin, may then be locked down by either annotating the controllers themselves or modifying Please let me know if these changes work for you. |
Thanks for replying! Does your theory involve the possibility that the web app and the plugin might end up depending on different versions of My example is oversimplified, separating domain classes from a simple UI app. Our actual use case is more complex, with multiple web apps relying on the same security infrastructure. I was hoping not to have to duplicate domain classes in each web app. In fact, right now my work-around is to copy the domain classes |
@dgoodman-idea, I have a solution for you. The issue does, in fact, appear to be a configuration problem. Access to URLs may be configured in one of three ways:
Your example application is using the The approach I recommend you take with your app is to use either the simple map or To use the simple map approach to enable access to the user controller for all users, modify your
Please note, I modified your config by:
I verified this approach allows access to the You will need to add additional patterns and accesses for your other controller endpoints and probably modify my example to lock down access to More information is available at Please let me know if this correctly addresses your issue! Thanks! |
@ddelponte I applied the changes you suggested and it still only works if I copy the domain classes into the
Is there something about SecurityUiTagLib that wouldn't be able to access a bean in another subproject? Maybe a classloader issue? |
Our team has a new Grails 3.3.9 multi-project. This issue manifests almost exactly like #56 but the work-around suggested there did not work. Ultimately, copying the Domain classes from myplugin into the myweb subproject fixed the issue. However, we want our Domain classes, including those for Spring Security (SecUser and SecRole) to reside in the shared plugin.
Task List
Steps to Reproduce
NOTE: If you clone the repo below, you can start with step 4
compile 'org.grails.plugins:spring-security-ui:3.1.2'
grails s2ui-override auth
grails s2ui-override layout
grails s2ui-override role com.example
(replace existing controller from earlier generate-all)grails s2ui-override user com.example
(replace existing controller from earlier generate-all)cd myweb; grails run-app
admin
and passwordstrongPassword
./role/create
or/user/create
Expected Behaviour
Create Role and Create User pages should load without error
Actual Behaviour
Full trace from grails:
Environment Information
Example Application
The text was updated successfully, but these errors were encountered: