Yes, it did work!

The original SQL query did not work right away, so I
looked more closely into the DB schema and guessed
that I should be using the '/role' node's node_id as
the 'parent_node_id' (204). That was a lucky guess and
the following query worked fine:
INSERT INTO PREFS_NODE
VALUES(200,204,'dce-admin-role',0,'/role/dce-admin-role','2004-05-22
16:27:12.472','2004-05-22 16:27:12.472');

After that, I was able to see the new role,
'dce-admin-role', in the 'Role Management' portlet's
list, and was able to assign this role to a user and
see it detected correctly by
PortletRequest.isUserInRole("dce-admin-role").

Thanks a lot for your help!

Marina


--- David Le Strat <[EMAIL PROTECTED]> wrote:

> Marina,
> 
> If you are doing this manually, you also need to set
> up the role hierarchy manager.  In SQL terms, this
> means something like this:
> 
> INSERT INTO PREFS_NODE
>
VALUES(200,196,'dce-admin-role',0,'/role/dce-admin-role','2004-05-22
> 16:27:12.472','2004-05-22 16:27:12.472');
> 
> You can also use the RoleManager to add the role you
> want to set up.
> 
> Regards,
> 
> David.
> 
> --- Marina <[EMAIL PROTECTED]> wrote:
> 
> > Thanks, Randy,
> > 
> > I tried adding the new role directly into the HSQL
> > DB
> > like this:
> > INSERT INTO SECURITY_PRINCIPAL
> >
>
VALUES(15,'org.apache.jetspeed.security.JetspeedRolePrincipalImpl',0,1,'/role/dce-admin-role','2004-12-15
> > 16:27:12.572','2004-12-15 16:27:12.572');
> > 
> > I ran this sql query directly on the HSQL DB,
> > without
> > modifying the
> populate-userinfo-for-default-psml.sql
> > and rebuilding J2.
> > 
> > After I restarted J2, though, the new role is
> still
> > not displayed in the list of available roles in
> the
> > "Role Management" portlet. And asigning this role
> to
> > a
> > user through the "User Manegement" portlet did not
> > work either.
> > 
> > Is this the only table I have to update
> > ('security_principal') in order to create a new
> > role,
> > or are there some other related tables that I
> > missed?
> > 
> > Thanks,
> > Marina
> > 
> > --- Randy Watler <[EMAIL PROTECTED]> wrote:
> > 
> > > Marina,
> > > 
> > > There you have it, (thanks David).
> > > 
> > > It is a simple matter to add users, roles,
> groups,
> > > etc. directly to the 
> > > DB in the interim. See one of the following
> > scripts:
> > > 
> > > CVS -
> > src/sql/populate-userinfo-for-default-psml.sql
> > > CVS - src/sql/<db
> > > name>/populate-userinfo-for-default-psml.sql
> > > M1 - 
> > >
> >
>
jetspeed-database/scripts/sql/DML/populate-userinfo-for-default-psml.sql
> > > M1 - jetspeed-database/scripts/sql/DML/<db 
> > > name>/populate-userinfo-for-default-psml.sql
> > > 
> > > Randy
> > > 
> > > David Le Strat wrote:
> > > 
> > > >Marina,
> > > >
> > > >Implementation of the role management portlet
> is
> > > not
> > > >complete.
> > > >
> > > >Regards,
> > > >
> > > >David Le Strat.
> > > >--- Marina <[EMAIL PROTECTED]> wrote:
> > > >
> > > >  
> > > >
> > > >>Randy, thanks a lot for your help! I was able
> to
> > > >>setup
> > > >>a basic access control to my portlet's view
> and
> > > Edit
> > > >>mode.
> > > >>I do have more questions on the user
> management
> > in
> > > >>J2,
> > > >>though :)
> > > >>
> > > >>I've created a new user, dce-admin,  using the
> > > >>"Administrative Portlets" as 'admin' user.
> This
> > > >>worked
> > > >>fine, and I was able to detect this user
> through
> > > the
> > > >>PortletResponse.getUserPrincipal().
> > > >>I've also tried to create a new role, say
> > > >>dce-admin-role, and assign this role to the
> new
> > > >>user.
> > > >>This , unfortunately, did not work. I entered
> > the
> > > >>new
> > > >>role name into the corresponding form ("Add
> > Role")
> > > >>of
> > > >>the "Role Management" tab, but it was never
> > added
> > > to
> > > >>the list of the available roles and when I
> tried
> > > to
> > > >>assign this role to the new user I've got an
> > error
> > > >>from J2 complaining that this role does not
> > exist:
> > > >>
> > > >>******* New Full Path: /role/dce-admin-role
> > > >>failed to add user to role: dce-admin,
> > > >>
> > > >>    
> > > >>
> > >
> >
>
>dce-admin-roleorg.apache.jetspeed.security.SecurityException:
> > > >  
> > > >
> > > >>The role does not exist. dce-admin-role
> > > >>******* New Full Path: /role/dce-admin-role
> > > >>
> > > >>
> > > >>Any idea why this is not working?
> > > >>
> > > >>Thanks,
> > > >>Marina
> > > >>
> > > >>    
> > > >>
> > > >  
> > > >
> > > 
> > >
> >
>
---------------------------------------------------------------------
> > > To unsubscribe, e-mail:
> > > [EMAIL PROTECTED]
> > > For additional commands, e-mail:
> > > [EMAIL PROTECTED]
> > > 
> > > 
> > 
> > 
> > 
> >             
> > __________________________________ 
> > Do you Yahoo!? 
> > Yahoo! Mail - Helps protect you from nasty
> viruses. 
> > http://promotions.yahoo.com/new_mail
> > 
> >
>
---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> > [EMAIL PROTECTED]
> > For additional commands, e-mail:
> > [EMAIL PROTECTED]
> > 
> > 
> 
> 
> 
>               
> __________________________________ 
> Do you Yahoo!? 
> Yahoo! Mail - Find what you need with new enhanced
> search.
> http://info.mail.yahoo.com/mail_250
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> 
=== message truncated ===



                
__________________________________ 
Do you Yahoo!? 
Yahoo! Mail - 250MB free storage. Do more. Manage less. 
http://info.mail.yahoo.com/mail_250

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to