javi_123 Posted July 13, 2009 Share Posted July 13, 2009 Hi All,I need to assign more than one role when a new user is created.By default, ROLE_USER role is assigned when a new user is created.I have looked at applicationContext.xml, where the default role is set to ROLE_USER:<property name="defaultRole" value="ROLE_USER"/>I want to add ROLE_USER and ROLE_DEMO as a default role when a new user is created. Have tried so many option but no result;(Please reply back with the solution.RegardsJavi Link to comment Share on other sites More sharing options...
javi_123 Posted July 14, 2009 Author Share Posted July 14, 2009 Does anyone know how to add this functionality. Regards Javed Link to comment Share on other sites More sharing options...
tkavanagh Posted July 15, 2009 Share Posted July 15, 2009 Are you creating the users programatically? Or do you just want to have the default setup for a new user - when the Administrative user is managing users - to have both roles automatically assigned by default so that there are less clicks needed by the Administrator to set up a new user? And are you using LDAP? Link to comment Share on other sites More sharing options...
deepthirohini86 Posted July 15, 2009 Share Posted July 15, 2009 Hi Javed, For this u can write some trigger for the jiuser table, whenever the new user is added , get that user id and insert the two roles for the jiuserrole table. Regards,Rohini A.M Link to comment Share on other sites More sharing options...
javi_123 Posted July 15, 2009 Author Share Posted July 15, 2009 Thanks a lot for your the suggessions. I have finally managed to get it working.I have added the follwing code in the userCreator.js file:if (defaultRole) { user.roles.push({roleName : defaultRole}) && user.roles.push({roleName : 'ROLE_LICENSE'}); } RegardsJaved Link to comment Share on other sites More sharing options...
tkavanagh Posted July 16, 2009 Share Posted July 16, 2009 Nice work ;-) I'll look for a location (will be reorganizing soon) on the wiki to collect this kind of information. Thanks. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now