Populating users and roles in Spring Roo with Springlets JPA

62 Views Asked by At

I'm at the end of a prototyping exercise. Done security setup --provider Springlets_JPA Current status - I get a banner with default user and admin with auto-generated passwords in the console. I'm able to login with those defaults. A bunch of user and login related tables, sequence tables were generated in the database. What are the steps to add more users?

I didn't see any user or role related controllers and views generated for user/role CRUD.Do we need to write those? Essentially - what are the next steps to get my usernames and roles into the system? I found zero documentation anywhere for this.I'm no Spring expert, and using Roo simply because its getting me quickly to a working app!

1

There are 1 best solutions below

0
Nebojsa VULIN On

Seem to remember that last time I played with this I added security setup --provider Springlets_JPA AFTER the controllers and views were done, and spent some time scratching my head on why the heck I have even no way to logout.

Fund a note to self: FIRST do security setup, and only AFTER that do controllers and views (which makes sense, in order to be aware that the controllers and views related to sec. are needed, the things have to be needed ;) ).

Bad news, the same note says that I had to fiddle manually adding table user_login_role, as the thing made only user_login and login_role tables itself. Smth like this:

CREATE TABLE IF NOT EXISTS `user_login_role` (
  `user_login_role_id` bigint(20) NOT NULL auto_increment,
  `version` bigint(20) default NULL,
  `login_role` bigint(20) NOT NULL,
  `user_login` bigint(20) NOT NULL,
  PRIMARY KEY  (`user_login_role_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=2 ;

Have no idea where I found this in the first place I am afraid, or weather it's still relevant but maybe it helps.