[EMAIL PROTECTED] wrote:

Le 12 avr. 07 à 17:38, Julien Anguenot a écrit :



I don't think this is good idea. the getName() should return the
principal id. All code at app level expects this. For me, this is pure
UI issue.
I agree with you. This is pure UI issue.... But a method called *getName* should return the Name of the principal and not it's id... (it should be a getId method instead).
The java.security.Principal.getName() method should return the login id.
Here is the javadoc of this interface:
* This interface represents the abstract notion of a principal, which
* can be used to represent any entity, such as an individual, a
* corporation, and a login id.

The getName() is the base method defined by java.security.Principal interface to return an identification for the principal (the login id) The getName() method is used by all login modules to retrieve the login name so that it can perform the authentication. You may have principal implementations that doesn't have full names or any additional description - but only an ID or login id - so these implementation will use the getName() to return the login id. So returning other stuff than the user id like user full name or other user description from this method will break the java security API. If we need some specific information about a principal like full name then we have to add new methods that does this in the base implementation of the NuxeoPrincipal. And in the UI we can use these methods to show the information we want and not the user id.

Principal.getName() is the only method (common to all Principal implementations) provided by java security API to return the login id and I think it should be used for this.



What we could do to tackle this could be just to extend the API of the
listener dealing with user and groups to provide a convenient method to
get the fullname.

 public String getFullNameFor(String principalName);

 public String getFullNameFor(NuxeoPrincipal principal);

or something like that we could use from the jsf and from other listeners.

Of course, this is a legitimate request...

What do you think ?

As I understand the problem of renaming the getName in getId method,
the API extension is a good workaround to fit my needs.
You cannot rename getName in getId since getName is part of java security API (see java.security.Principal)

Regards,
Bogdan



Cheers,

J.

--
Julien Anguenot | Nuxeo R&D (Paris, France)
Open Source ECM - http://www.nuxeo.com
Nuxeo 5 : http://www.nuxeo.org
Mobile: +33 (0) 6 72 57 57 66


--

Damien Metzler
Leroy Merlin - Tel : 03 28 80 89 03
Email : [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>





Ce message et toutes les pieces jointes sont etablis a l'attention exclusive de leurs destinataires et sont confidentiels. Si vous recevez ce message par erreur, merci de le detruire et d'en avertir immediatement l'expediteur. L'internet ne permettant pas d'assurer l'integrite de ce message, le contenu de ce message ne represente en aucun cas un engagement de la part de Leroy Merlin.

------------------------------------------------------------------------

_______________________________________________
ECM mailing list
[EMAIL PROTECTED]
http://lists.nuxeo.com/mailman/listinfo/ecm

_______________________________________________
ECM mailing list
[EMAIL PROTECTED]
http://lists.nuxeo.com/mailman/listinfo/ecm

Reply via email to