def s3_roles_permitted(name='roles_permitted', **attr):
 T = current.T
 represent = S3Represent(lookup='auth_group', fields=['role'])
 if ('label' not in attr):
  attr['label'] = T('Roles Permitted')
 if ('sortby' not in attr):
  attr['sortby'] = 'role'
 if ('represent' not in attr):
  attr['represent'] = represent
 if ('requires' not in attr):
  attr['requires'] = IS_EMPTY_OR(IS_ONE_OF(current.db, 'auth_group.id', represent, multiple=True))
 if ('comment' not in attr):
  attr['comment'] = DIV(_class='tooltip', _title=('%s|%s' % (T('Roles Permitted'), T('If this record should be restricted then select which role(s) are permitted to access the record here.'))))
 if ('ondelete' not in attr):
  attr['ondelete'] = 'RESTRICT'
 f = S3ReusableField(name, 'list:reference auth_group', **attr)
 return f()

def s3_roles_permitted ( name = 'roles_permitted' , ** attr ) : T = current . T represent = S3Represent ( lookup = 'auth_group' , fields = [ 'role' ] ) if ( 'label' not in attr ) : attr [ 'label' ] = T ( 'Roles Permitted' ) if ( 'sortby' not in attr ) : attr [ 'sortby' ] = 'role' if ( 'represent' not in attr ) : attr [ 'represent' ] = represent if ( 'requires' not in attr ) : attr [ 'requires' ] = IS_EMPTY_OR ( IS_ONE_OF ( current . db , 'auth_group.id' , represent , multiple = True ) ) if ( 'comment' not in attr ) : attr [ 'comment' ] = DIV ( _class = 'tooltip' , _title = ( '%s|%s' % ( T ( 'Roles Permitted' ) , T ( 'If this record should be restricted then select which role(s) are permitted to access the record here.' ) ) ) ) if ( 'ondelete' not in attr ) : attr [ 'ondelete' ] = 'RESTRICT' f = S3ReusableField ( name , 'list:reference auth_group' , ** attr ) return f ( )
list of roles permitted to access a resource - used by cms .