extra fields are available in my auth.user var  but they have "None"
instead of the real value

 so i create an extra function


def checkempreiteiro(user):
    print auth.user.isempreiteiro  # *returns None*
    record=db(db.auth_user.id==user).select()[0]
    return record['isempreiteiro'] #*returns True*


@auth.requires_login()
@auth.requires(checkempreiteiro(auth.user_id)==True)




2012/12/20 Massimo Di Pierro <[email protected]>

> @requires(auth.user.F1=='F')
> def yourfunction(...): ....
>
>
> On Thursday, 20 December 2012 06:40:09 UTC-6, Ramos wrote:
>>
>> hello i have a function to be acessed only by users with an extra field
>> F1 set to "F"
>>
>> how to protect this function to not be used bu everyone?
>>
>> what is the best way?
>>
>> thank you
>> António
>>
>  --
>
>
>
>

-- 



Reply via email to