Surely sendmail reeled when thusly spake Geert Bevin:
>
> Please use the RoleUsersManager to get the roles of the user. 

Ehhh ... that's what I did, innit ?

Class MemoryUsers implements RoleUsersManager, 
  and in order to call the method 

        boolean listUserRoles(String login, ListRoles processor) 

you have to define and pass to it an instance of a ListRoles. 

Or am I missing something fundamental here ?


In defining this ListRoles, I used some tricky syntax, which was 
the reason for the "final" qualifier on the ArrayList<String>. 


fred


> The method acceptedCredentials contains just the data that was sent to  
> the authentication layer to *verify* the credentials. This is not the  
> same as all the data of the Account+
> 
> On 16-aug-05, at 16:09, F Baube wrote:
> 
> >Surely sendmail reeled when thusly spake Geert Bevin:
> >
> >>
> >>No, these are the credentials that are submitted by the form.
> >>
> >
> >Well, a form does not submit a role, it is Rife that decides
> >what role to pass to my authent class.  My point is only that
> >Rife passes _only_ the role that has been specified for access
> >to the Element that is being protected, and it can pass no role
> >at all.
> >
> >
> >>If you want to know which roles an account is in, you have
> >>to look is up through the RoleUsersManager.
> >>
> >
> >Yup !  Clip-n-save:
> >
> >    public static List<String> getRolesByUser(String login) {
> >
> >    final ArrayList AL = new ArrayList<String>();
> >    assert (login != null);
> >    assert (login.length() != 0);
> >    MemoryUsers MU = (MemoryUsers) MemoryUsers.getRepInstance());
> >    try {
> >        MU.listUserRoles(login, new ListRoles() {
> >             public boolean foundRole(String role) {
> >            AL.add(role); return (true); }
> >        });
> >    } catch (CredentialsManagerException cme) {
> >        return (null);
> >    }
> >    return (AL);
> >    }
> >
> >fred
> >
> >
> >
> >>>>If you don't specify any value for the role property in the
> >>>>authenticated element declaration, any valid user can login.
> >>>>
> >>>
> >>>So it seems.  Altho this also means that when
> >>>
> >>>   MemoryAuthenticated.acceptedCredentials(Credentials creds)
> >>>
> >>>is called, there is no value for "role" in the Credentials,
> >>>since none was required.
> >>>
> >>>   class MyAuth extends MemoryAuthenticated {
> >>>
> >>>       protected void acceptedCredentials(Credentials C) {
> >>>
> >>>       RoleUserCredentials RUC = (RoleUserCredentials) C;
> >>>       login = RUC.getLogin();
> >>>       paswd = RUC.getPassword();
> >>>       role  = RUC.getRole(); // returns (null)
> >>>       [..]

_______________________________________________
Rife-users mailing list
[email protected]
http://www.uwyn.com/mailman/listinfo/rife-users

Reply via email to