If you are using the auth object as configured in the scaffolding app
model, it is possible to customize auth with this variables (maybe the
list is incomplete):

auth.settings.register_onvalidation
auth.settings.register_onaccept
auth.settings.register_next

.._onvalidation is a list of functions to run on validation, so you
can define the extra code there.

On 3 ene, 08:42, tsvim <[email protected]> wrote:
> Ok, I changed my code again.
>
> Incredible how so many things were though through before. (Multi-tenancy,
> common_fields, extra_fields in auth, ...)
> A big thumbs up to all the devs on this.
>
> What I'd like to do now is have a custom registration action (not form).
> I added an extra_field to the auth_user table which should be stored from a
> session variable.
> I also would like to create a group based on that same variable and add the
> user to that group.
> So I should have something like this in my registration action:
>   auth.user.last_opened = session.token
>   auth.add_membership(auth.add_group(session.token), auth.user.id)
>
> Where last_opened is the name of the new field in auth_user.
> The reason I want to use the add_membership is I'd like multiple users to
> be able to share data according to the token.
> This way new users can be added to the requested group, allowing them to
> edit the data without touching the personal user's permissions.
>
> How do I go about creating my custom action?
> Note that I'd like to still use the view available by the user action if
> possible, or at least have the other user actions still available while
> overriding the register action only.
>
> Thanks for your help,
>
> Tsvi

Reply via email to