I enabled authentication and have the following entries in the
auth_user, auth_group and auth_membership tables:

user.id    user.first_name      ...
1             Ann
2             Jan


group.id    group.role
1               user_1
2               user_2


membership.id    membership.user_id    membership.group.id
1                          1
user_1(1)
2                          2
user_2(2)


Now, I would like to add permissions, the problem is that
auth.add_persmission() takes the following arguments: group_id,
'name', 'object', record_id whereas I need to set permissions related
to a tables company_id field. I have tables that have the following
structure:

db.define_table('tagline',
 
Field('company_id',db.bedrijf,default='',notnull=True,ondelete='CASCADE'),
    Field('line',length=84,default='',notnull=True),
    migrate=’tagline.table’)


Now user with user_id 1 and group_id user_1(1) should get the
permission to create, update and delete all records in the tagline
table that have company_id 443. Is that possible in web2py's, or do I
have to customize one of the auth tables to make this possible?


Kind regards,

Annet.

Reply via email to