You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by "Nikhil G. Daddikar" <ng...@celoxis.com> on 2002/04/08 09:19:36 UTC

SecurityService & UserPeer Dependence

Folks,

I have been studying Turbine (2.1) to see how to fit in my own User 
implementation. During that process I  noticed a few things which I 
would like clarification on.

Security classes Role, Permission and Group deal with USER_ID (according 
to the schema). The concept of UserPeer has been introduced so that 
RolePeer.retrieve(User, Group) can do an SQL join to figure out the 
USER_ID from the USERNAME as indicated below in the code:

        UserPeer up =            
            ((DBSecurityService)TurbineSecurity.getService())
            .getUserPeerInstance();

        criteria.add(up.getFullColumnName(UserPeer.USERNAME),
                     user.getUserName());
        criteria.add(UserGroupRolePeer.GROUP_ID,
                     ((Persistent)group).getPrimaryKey());

        criteria.addJoin(up.getFullColumnName(UserPeer.USER_ID),
                         UserGroupRolePeer.USER_ID);
        criteria.addJoin(UserGroupRolePeer.ROLE_ID, RolePeer.ROLE_ID);
        criteria.toString();
        return retrieveSet(criteria);

If the ID (int) was available in some way, the concept of UserPeer (as 
it is now) will disappear.

In my case the User will be in a directory (accessible through LDAP) and 
hence there will be no columns to join on. However, all users have a 
unique ID (int) and I still want to use the TurbineSecurity system 
(database form) which is quite great.

Instead of depending on UserPeer's column names, if  there was a way to 
get the integer ID from the username, that would have sufficed.

Now I don't know how to proceed.

Have I missed anything? Any help will be greatly appreciated.

Thanks.
-ngd.






--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: SecurityService & UserPeer Dependence

Posted by Rajeev Kaul <Ra...@customercaresolutions.com>.
Eric,

I am sorry if I implied that I have a working LDAP version of Turbine
Security implemented.  I certainly would not mind contributing it to
Turbine, if I had a working LDAP Security implementation.

Rajeev
----- Original Message -----
From: "Eric Dobbs" <er...@dobbse.net>
To: "Turbine Users List" <tu...@jakarta.apache.org>
Sent: Thursday, April 11, 2002 7:23 AM
Subject: Re: SecurityService & UserPeer Dependence


>
> On Wednesday, April 10, 2002, at 01:15  PM, Rajeev Kaul wrote:
>
> > Turbine comes with LDAP versions of these classes.
> > However, they do not work.  You will need to put in some elbow grease to
> > make them work properly.
>
> Rajeev,
>
> Have you put in the elbow grease to make the LDAP work?
> If so, would you consider contributing your work so
> that others may benefit?  Using LDAP with Turbine
> Security is a request that comes up about every six
> weeks or so, but it seems no one ever finds the time to
> follow through on fixing it.  In other words, it would
> be a welcome addition if you've got it working.
>
> -Eric
>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: SecurityService & UserPeer Dependence

Posted by Eric Dobbs <er...@dobbse.net>.
On Wednesday, April 10, 2002, at 01:15  PM, Rajeev Kaul wrote:

> Turbine comes with LDAP versions of these classes.
> However, they do not work.  You will need to put in some elbow grease to
> make them work properly.

Rajeev,

Have you put in the elbow grease to make the LDAP work?
If so, would you consider contributing your work so
that others may benefit?  Using LDAP with Turbine
Security is a request that comes up about every six
weeks or so, but it seems no one ever finds the time to
follow through on fixing it.  In other words, it would
be a welcome addition if you've got it working.

-Eric


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: SecurityService & UserPeer Dependence

Posted by Rajeev Kaul <Ra...@customercaresolutions.com>.
Nikhil,

The Peer objects are for the Torque-O-R database implementation of security.
If you want to use some other mechanism like LDAP, you will need to write
your own classes to replace the DbSecurityService class and the
DbUserManager class.  Turbine comes with LDAP versions of these classes.
However, they do not work.  You will need to put in some elbow grease to
make them work properly.

Rajeev


----- Original Message -----
From: "Nikhil G. Daddikar" <ng...@celoxis.com>
To: "Turbine Users List" <tu...@jakarta.apache.org>
Sent: Monday, April 08, 2002 9:03 AM
Subject: Re: SecurityService & UserPeer Dependence


> What I am saying is that I want to use Turbine Security but I don't have
users in a relational database and the only
> reason UserPeer was invented is because RolePeer can do a join to get the
user id, which it could have got in a
> different way than through UserPeer.
>
> For example, UserPeer just had a getId(String username) method, that would
have sufficed.
>
> Thanks.
>
> ----- Original Message -----
>
> : Hi UserPeer was created for you to implement it.
> : Implement UserPeer to indicate which TABLE and COLUMN are to used by
> : TSecuritySystem. for example :
> :
> : public class YourPeer implements UserPeer
> : {
> : public static final String USER_ID = YOUR_TABLE.YOUR_ID_COLUMN;
> : ...
> : }
> :
> : and you must edit TR.conf to use your UserPeer impl.
> :
> :
> : On Mon, 2002-04-08 at 04:19, Nikhil G. Daddikar wrote:
> :
> :
> : > Folks,
> : >
> : > I have been studying Turbine (2.1) to see how to fit in my own User
> : > implementation. During that process I  noticed a few things which I
> : > would like clarification on.
> : >
> : > Security classes Role, Permission and Group deal with USER_ID
(according
> : > to the schema). The concept of UserPeer has been introduced so that
> : > RolePeer.retrieve(User, Group) can do an SQL join to figure out the
> : > USER_ID from the USERNAME as indicated below in the code:
> : >
> : >         UserPeer up =
> : >             ((DBSecurityService)TurbineSecurity.getService())
> : >             .getUserPeerInstance();
> : >
> : >         criteria.add(up.getFullColumnName(UserPeer.USERNAME),
> : >                      user.getUserName());
> : >         criteria.add(UserGroupRolePeer.GROUP_ID,
> : >                      ((Persistent)group).getPrimaryKey());
> : >
> : >         criteria.addJoin(up.getFullColumnName(UserPeer.USER_ID),
> : >                          UserGroupRolePeer.USER_ID);
> : >         criteria.addJoin(UserGroupRolePeer.ROLE_ID, RolePeer.ROLE_ID);
> : >         criteria.toString();
> : >         return retrieveSet(criteria);
> : >
> : > If the ID (int) was available in some way, the concept of UserPeer (as
> : > it is now) will disappear.
> : >
> : > In my case the User will be in a directory (accessible through LDAP)
and
> : > hence there will be no columns to join on. However, all users have a
> : > unique ID (int) and I still want to use the TurbineSecurity system
> : > (database form) which is quite great.
> : >
> : > Instead of depending on UserPeer's column names, if  there was a way
to
> : > get the integer ID from the username, that would have sufficed.
> : >
> : > Now I don't know how to proceed.
> : >
> : > Have I missed anything? Any help will be greatly appreciated.
> : >
> : > Thanks.
> : > -ngd.
> : >
> : >
> : >
> : >
> : >
> : >
> : > --
> : > To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> : > For additional commands, e-mail:
<ma...@jakarta.apache.org>
> : --
> : Leandro Rodrigo Saad Cruz
> : IT - Inter Business Tecnologia e Servicos (IB)
> : http://www.ibnetwork.com.br
> :
> :
> : --
> : To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> : For additional commands, e-mail:
<ma...@jakarta.apache.org>
> :
> :
> :
>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: SecurityService & UserPeer Dependence

Posted by John McNally <jm...@collab.net>.
Present a better interface in the form of a patch and it will be applied
to cvs.  The security service was originally completely db centered. 
There have been attempts to generalize it, but obviously some things
could use improvement.

john mcnally

"Nikhil G. Daddikar" wrote:
> 
> :
> : That won't work because TSS retrieves roles and permissions using joins
> : into the DB.
> : You can change the way Roles and Permissions are retrieved if you want.
> :
> 
> That is precisely my point. Why does it do a join? Why can't it just ask for the ID from some interface? Remember, it
> does a join because it doesn't have the ID, no other reason. The assumption that users should be in the database as well
> is quite un-necessary.
> 
> thanks!
> -ngd.
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: SecurityService & UserPeer Dependence

Posted by "Nikhil G. Daddikar" <ng...@celoxis.com>.
:
: That won't work because TSS retrieves roles and permissions using joins
: into the DB.
: You can change the way Roles and Permissions are retrieved if you want.
:

That is precisely my point. Why does it do a join? Why can't it just ask for the ID from some interface? Remember, it
does a join because it doesn't have the ID, no other reason. The assumption that users should be in the database as well
is quite un-necessary.

thanks!
-ngd.


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: SecurityService & UserPeer Dependence

Posted by Leandro Rodrigo Saad Cruz <le...@ibnetwork.com.br>.
On Mon, 2002-04-08 at 13:03, Nikhil G. Daddikar wrote:
> What I am saying is that I want to use Turbine Security but I don't have users in a relational database and the only
> reason UserPeer was invented is because RolePeer can do a join to get the user id, which it could have got in a
> different way than through UserPeer.
> 
> For example, UserPeer just had a getId(String username) method, that would have sufficed.

That won't work because TSS retrieves roles and permissions using joins
into the DB.
You can change the way Roles and Permissions are retrieved if you want.

> 
> Thanks.
> 
> ----- Original Message -----
> 
> : Hi UserPeer was created for you to implement it.
> : Implement UserPeer to indicate which TABLE and COLUMN are to used by
> : TSecuritySystem. for example :
> :
> : public class YourPeer implements UserPeer
> : {
> : public static final String USER_ID = YOUR_TABLE.YOUR_ID_COLUMN;
> : ...
> : }
> :
> : and you must edit TR.conf to use your UserPeer impl.
> :
> :
> : On Mon, 2002-04-08 at 04:19, Nikhil G. Daddikar wrote:
> :
> :
> : > Folks,
> : >
> : > I have been studying Turbine (2.1) to see how to fit in my own User
> : > implementation. During that process I  noticed a few things which I
> : > would like clarification on.
> : >
> : > Security classes Role, Permission and Group deal with USER_ID (according
> : > to the schema). The concept of UserPeer has been introduced so that
> : > RolePeer.retrieve(User, Group) can do an SQL join to figure out the
> : > USER_ID from the USERNAME as indicated below in the code:
> : >
> : >         UserPeer up =
> : >             ((DBSecurityService)TurbineSecurity.getService())
> : >             .getUserPeerInstance();
> : >
> : >         criteria.add(up.getFullColumnName(UserPeer.USERNAME),
> : >                      user.getUserName());
> : >         criteria.add(UserGroupRolePeer.GROUP_ID,
> : >                      ((Persistent)group).getPrimaryKey());
> : >
> : >         criteria.addJoin(up.getFullColumnName(UserPeer.USER_ID),
> : >                          UserGroupRolePeer.USER_ID);
> : >         criteria.addJoin(UserGroupRolePeer.ROLE_ID, RolePeer.ROLE_ID);
> : >         criteria.toString();
> : >         return retrieveSet(criteria);
> : >
> : > If the ID (int) was available in some way, the concept of UserPeer (as
> : > it is now) will disappear.
> : >
> : > In my case the User will be in a directory (accessible through LDAP) and
> : > hence there will be no columns to join on. However, all users have a
> : > unique ID (int) and I still want to use the TurbineSecurity system
> : > (database form) which is quite great.
> : >
> : > Instead of depending on UserPeer's column names, if  there was a way to
> : > get the integer ID from the username, that would have sufficed.
> : >
> : > Now I don't know how to proceed.
> : >
> : > Have I missed anything? Any help will be greatly appreciated.
> : >
> : > Thanks.
> : > -ngd.
> : >
> : >
> : >
> : >
> : >
> : >
> : > --
> : > To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> : > For additional commands, e-mail: <ma...@jakarta.apache.org>
> : --
> : Leandro Rodrigo Saad Cruz
> : IT - Inter Business Tecnologia e Servicos (IB)
> : http://www.ibnetwork.com.br
> :
> :
> : --
> : To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> : For additional commands, e-mail: <ma...@jakarta.apache.org>
> :
> :
> :
> 
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
-- 
Leandro Rodrigo Saad Cruz
IT - Inter Business Tecnologia e Servicos (IB)
http://www.ibnetwork.com.br


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: SecurityService & UserPeer Dependence

Posted by Edgar Gonzalez <eg...@valhallaproject.com>.
Nikhil,

We are not sure at this time if the Turbine Security Scheme works for our
scenario, we want to implement a centralized security repository, we talk
about applications, groups, roles (within applications), permissions, and
users. We are reviewing if we can use the Turbine Security Schema just like
that, or if we have to modified, or extend some classes e.g
AccessControlList, etc.

> The only solution I can think of is to have a table with two columns
(username and id) and always sync with LDAP (either
> in real-time, when the user logs in OR in batch). The mapping of username
and id will remain stable since nothing will
> change.

We are considering the same approach, and the use of a scheduled job
responsible for the sync between LDAP and RDBMS.

Edgar


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: SecurityService & UserPeer Dependence

Posted by "Nikhil G. Daddikar" <ng...@celoxis.com>.
Hi Edgar,

Yes, we can definitely co-operate.

Turbine has made things really simple for using it's security service (TSS). You need to implement User, UserManager;
both are simple. It's the design of UserPeer which we need to implement is the problem. UserPeer is required by DB
implementation of TSS, which I and I guess, you, want to use. Instead of having a getId(username) method, it says give
me the username and let me do a join. And *that* is the problem. It could have been very easy if they had chosen the ID
way.

The only solution I can think of is to have a table with two columns (username and id) and always sync with LDAP (either
in real-time, when the user logs in OR in batch). The mapping of username and id will remain stable since nothing will
change.

Ideas?
-ngd.
----- Original Message -----
From: "Edgar Gonzalez" <eg...@valhallaproject.com>
To: "Turbine Users List" <tu...@jakarta.apache.org>
Sent: Tuesday, April 09, 2002 1:14 PM
Subject: Re: SecurityService & UserPeer Dependence


: Hi Nikhil,
:
: I'm working in something similar, Users stored in some LDAP backend, and
: still using the TurbineSecurity bases to Groups, Roles, etc..
: Maybe we can share ideas
:
: Edgar
:
:
: ----- Original Message -----
: From: "Nikhil G. Daddikar" <ng...@celoxis.com>
: To: "Turbine Users List" <tu...@jakarta.apache.org>
: Sent: Monday, April 08, 2002 12:03 PM
: Subject: Re: SecurityService & UserPeer Dependence
:
:
: > What I am saying is that I want to use Turbine Security but I don't have
: users in a relational database and the only
: > reason UserPeer was invented is because RolePeer can do a join to get the
: user id, which it could have got in a
: > different way than through UserPeer.
: >
: > For example, UserPeer just had a getId(String username) method, that would
: have sufficed.
: >
: > Thanks.
: >
: > ----- Original Message -----
: >
: > : Hi UserPeer was created for you to implement it.
: > : Implement UserPeer to indicate which TABLE and COLUMN are to used by
: > : TSecuritySystem. for example :
: > :
: > : public class YourPeer implements UserPeer
: > : {
: > : public static final String USER_ID = YOUR_TABLE.YOUR_ID_COLUMN;
: > : ...
: > : }
: > :
: > : and you must edit TR.conf to use your UserPeer impl.
: > :
: > :
: > : On Mon, 2002-04-08 at 04:19, Nikhil G. Daddikar wrote:
: > :
: > :
: > : > Folks,
: > : >
: > : > I have been studying Turbine (2.1) to see how to fit in my own User
: > : > implementation. During that process I  noticed a few things which I
: > : > would like clarification on.
: > : >
: > : > Security classes Role, Permission and Group deal with USER_ID
: (according
: > : > to the schema). The concept of UserPeer has been introduced so that
: > : > RolePeer.retrieve(User, Group) can do an SQL join to figure out the
: > : > USER_ID from the USERNAME as indicated below in the code:
: > : >
: > : >         UserPeer up =
: > : >             ((DBSecurityService)TurbineSecurity.getService())
: > : >             .getUserPeerInstance();
: > : >
: > : >         criteria.add(up.getFullColumnName(UserPeer.USERNAME),
: > : >                      user.getUserName());
: > : >         criteria.add(UserGroupRolePeer.GROUP_ID,
: > : >                      ((Persistent)group).getPrimaryKey());
: > : >
: > : >         criteria.addJoin(up.getFullColumnName(UserPeer.USER_ID),
: > : >                          UserGroupRolePeer.USER_ID);
: > : >         criteria.addJoin(UserGroupRolePeer.ROLE_ID, RolePeer.ROLE_ID);
: > : >         criteria.toString();
: > : >         return retrieveSet(criteria);
: > : >
: > : > If the ID (int) was available in some way, the concept of UserPeer (as
: > : > it is now) will disappear.
: > : >
: > : > In my case the User will be in a directory (accessible through LDAP)
: and
: > : > hence there will be no columns to join on. However, all users have a
: > : > unique ID (int) and I still want to use the TurbineSecurity system
: > : > (database form) which is quite great.
: > : >
: > : > Instead of depending on UserPeer's column names, if  there was a way
: to
: > : > get the integer ID from the username, that would have sufficed.
: > : >
: > : > Now I don't know how to proceed.
: > : >
: > : > Have I missed anything? Any help will be greatly appreciated.
: > : >
: > : > Thanks.
: > : > -ngd.
: > : >
: > : >
: > : >
: > : >
: > : >
: > : >
: > : > --
: > : > To unsubscribe, e-mail:
: <ma...@jakarta.apache.org>
: > : > For additional commands, e-mail:
: <ma...@jakarta.apache.org>
: > : --
: > : Leandro Rodrigo Saad Cruz
: > : IT - Inter Business Tecnologia e Servicos (IB)
: > : http://www.ibnetwork.com.br
: > :
: > :
: > : --
: > : To unsubscribe, e-mail:
: <ma...@jakarta.apache.org>
: > : For additional commands, e-mail:
: <ma...@jakarta.apache.org>
: > :
: > :
: > :
: >
: >
: > --
: > To unsubscribe, e-mail:
: <ma...@jakarta.apache.org>
: > For additional commands, e-mail:
: <ma...@jakarta.apache.org>
: >
: >
: >
:
:
: --
: To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
: For additional commands, e-mail: <ma...@jakarta.apache.org>
:
:
:


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: SecurityService & UserPeer Dependence

Posted by Edgar Gonzalez <eg...@valhallaproject.com>.
Hi Nikhil,

I'm working in something similar, Users stored in some LDAP backend, and
still using the TurbineSecurity bases to Groups, Roles, etc..
Maybe we can share ideas

Edgar


----- Original Message -----
From: "Nikhil G. Daddikar" <ng...@celoxis.com>
To: "Turbine Users List" <tu...@jakarta.apache.org>
Sent: Monday, April 08, 2002 12:03 PM
Subject: Re: SecurityService & UserPeer Dependence


> What I am saying is that I want to use Turbine Security but I don't have
users in a relational database and the only
> reason UserPeer was invented is because RolePeer can do a join to get the
user id, which it could have got in a
> different way than through UserPeer.
>
> For example, UserPeer just had a getId(String username) method, that would
have sufficed.
>
> Thanks.
>
> ----- Original Message -----
>
> : Hi UserPeer was created for you to implement it.
> : Implement UserPeer to indicate which TABLE and COLUMN are to used by
> : TSecuritySystem. for example :
> :
> : public class YourPeer implements UserPeer
> : {
> : public static final String USER_ID = YOUR_TABLE.YOUR_ID_COLUMN;
> : ...
> : }
> :
> : and you must edit TR.conf to use your UserPeer impl.
> :
> :
> : On Mon, 2002-04-08 at 04:19, Nikhil G. Daddikar wrote:
> :
> :
> : > Folks,
> : >
> : > I have been studying Turbine (2.1) to see how to fit in my own User
> : > implementation. During that process I  noticed a few things which I
> : > would like clarification on.
> : >
> : > Security classes Role, Permission and Group deal with USER_ID
(according
> : > to the schema). The concept of UserPeer has been introduced so that
> : > RolePeer.retrieve(User, Group) can do an SQL join to figure out the
> : > USER_ID from the USERNAME as indicated below in the code:
> : >
> : >         UserPeer up =
> : >             ((DBSecurityService)TurbineSecurity.getService())
> : >             .getUserPeerInstance();
> : >
> : >         criteria.add(up.getFullColumnName(UserPeer.USERNAME),
> : >                      user.getUserName());
> : >         criteria.add(UserGroupRolePeer.GROUP_ID,
> : >                      ((Persistent)group).getPrimaryKey());
> : >
> : >         criteria.addJoin(up.getFullColumnName(UserPeer.USER_ID),
> : >                          UserGroupRolePeer.USER_ID);
> : >         criteria.addJoin(UserGroupRolePeer.ROLE_ID, RolePeer.ROLE_ID);
> : >         criteria.toString();
> : >         return retrieveSet(criteria);
> : >
> : > If the ID (int) was available in some way, the concept of UserPeer (as
> : > it is now) will disappear.
> : >
> : > In my case the User will be in a directory (accessible through LDAP)
and
> : > hence there will be no columns to join on. However, all users have a
> : > unique ID (int) and I still want to use the TurbineSecurity system
> : > (database form) which is quite great.
> : >
> : > Instead of depending on UserPeer's column names, if  there was a way
to
> : > get the integer ID from the username, that would have sufficed.
> : >
> : > Now I don't know how to proceed.
> : >
> : > Have I missed anything? Any help will be greatly appreciated.
> : >
> : > Thanks.
> : > -ngd.
> : >
> : >
> : >
> : >
> : >
> : >
> : > --
> : > To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> : > For additional commands, e-mail:
<ma...@jakarta.apache.org>
> : --
> : Leandro Rodrigo Saad Cruz
> : IT - Inter Business Tecnologia e Servicos (IB)
> : http://www.ibnetwork.com.br
> :
> :
> : --
> : To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> : For additional commands, e-mail:
<ma...@jakarta.apache.org>
> :
> :
> :
>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>
>
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: SecurityService & UserPeer Dependence

Posted by "Nikhil G. Daddikar" <ng...@celoxis.com>.
What I am saying is that I want to use Turbine Security but I don't have users in a relational database and the only
reason UserPeer was invented is because RolePeer can do a join to get the user id, which it could have got in a
different way than through UserPeer.

For example, UserPeer just had a getId(String username) method, that would have sufficed.

Thanks.

----- Original Message -----

: Hi UserPeer was created for you to implement it.
: Implement UserPeer to indicate which TABLE and COLUMN are to used by
: TSecuritySystem. for example :
:
: public class YourPeer implements UserPeer
: {
: public static final String USER_ID = YOUR_TABLE.YOUR_ID_COLUMN;
: ...
: }
:
: and you must edit TR.conf to use your UserPeer impl.
:
:
: On Mon, 2002-04-08 at 04:19, Nikhil G. Daddikar wrote:
:
:
: > Folks,
: >
: > I have been studying Turbine (2.1) to see how to fit in my own User
: > implementation. During that process I  noticed a few things which I
: > would like clarification on.
: >
: > Security classes Role, Permission and Group deal with USER_ID (according
: > to the schema). The concept of UserPeer has been introduced so that
: > RolePeer.retrieve(User, Group) can do an SQL join to figure out the
: > USER_ID from the USERNAME as indicated below in the code:
: >
: >         UserPeer up =
: >             ((DBSecurityService)TurbineSecurity.getService())
: >             .getUserPeerInstance();
: >
: >         criteria.add(up.getFullColumnName(UserPeer.USERNAME),
: >                      user.getUserName());
: >         criteria.add(UserGroupRolePeer.GROUP_ID,
: >                      ((Persistent)group).getPrimaryKey());
: >
: >         criteria.addJoin(up.getFullColumnName(UserPeer.USER_ID),
: >                          UserGroupRolePeer.USER_ID);
: >         criteria.addJoin(UserGroupRolePeer.ROLE_ID, RolePeer.ROLE_ID);
: >         criteria.toString();
: >         return retrieveSet(criteria);
: >
: > If the ID (int) was available in some way, the concept of UserPeer (as
: > it is now) will disappear.
: >
: > In my case the User will be in a directory (accessible through LDAP) and
: > hence there will be no columns to join on. However, all users have a
: > unique ID (int) and I still want to use the TurbineSecurity system
: > (database form) which is quite great.
: >
: > Instead of depending on UserPeer's column names, if  there was a way to
: > get the integer ID from the username, that would have sufficed.
: >
: > Now I don't know how to proceed.
: >
: > Have I missed anything? Any help will be greatly appreciated.
: >
: > Thanks.
: > -ngd.
: >
: >
: >
: >
: >
: >
: > --
: > To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
: > For additional commands, e-mail: <ma...@jakarta.apache.org>
: --
: Leandro Rodrigo Saad Cruz
: IT - Inter Business Tecnologia e Servicos (IB)
: http://www.ibnetwork.com.br
:
:
: --
: To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
: For additional commands, e-mail: <ma...@jakarta.apache.org>
:
:
:


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: SecurityService & UserPeer Dependence

Posted by Leandro Rodrigo Saad Cruz <le...@ibnetwork.com.br>.
Hi UserPeer was created for you to implement it.
Implement UserPeer to indicate which TABLE and COLUMN are to used by
TSecuritySystem. for example :

public class YourPeer implements UserPeer
{
	public static final String USER_ID = YOUR_TABLE.YOUR_ID_COLUMN;
	...
}

and you must edit TR.conf to use your UserPeer impl.


On Mon, 2002-04-08 at 04:19, Nikhil G. Daddikar wrote:


> Folks,
> 
> I have been studying Turbine (2.1) to see how to fit in my own User 
> implementation. During that process I  noticed a few things which I 
> would like clarification on.
> 
> Security classes Role, Permission and Group deal with USER_ID (according 
> to the schema). The concept of UserPeer has been introduced so that 
> RolePeer.retrieve(User, Group) can do an SQL join to figure out the 
> USER_ID from the USERNAME as indicated below in the code:
> 
>         UserPeer up =            
>             ((DBSecurityService)TurbineSecurity.getService())
>             .getUserPeerInstance();
> 
>         criteria.add(up.getFullColumnName(UserPeer.USERNAME),
>                      user.getUserName());
>         criteria.add(UserGroupRolePeer.GROUP_ID,
>                      ((Persistent)group).getPrimaryKey());
> 
>         criteria.addJoin(up.getFullColumnName(UserPeer.USER_ID),
>                          UserGroupRolePeer.USER_ID);
>         criteria.addJoin(UserGroupRolePeer.ROLE_ID, RolePeer.ROLE_ID);
>         criteria.toString();
>         return retrieveSet(criteria);
> 
> If the ID (int) was available in some way, the concept of UserPeer (as 
> it is now) will disappear.
> 
> In my case the User will be in a directory (accessible through LDAP) and 
> hence there will be no columns to join on. However, all users have a 
> unique ID (int) and I still want to use the TurbineSecurity system 
> (database form) which is quite great.
> 
> Instead of depending on UserPeer's column names, if  there was a way to 
> get the integer ID from the username, that would have sufficed.
> 
> Now I don't know how to proceed.
> 
> Have I missed anything? Any help will be greatly appreciated.
> 
> Thanks.
> -ngd.
> 
> 
> 
> 
> 
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
-- 
Leandro Rodrigo Saad Cruz
IT - Inter Business Tecnologia e Servicos (IB)
http://www.ibnetwork.com.br


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>