Skip to content
Snippets Groups Projects
Commit d8672f0f authored by Anup Chavda's avatar Anup Chavda
Browse files

[FIX] Groups if removed, should remove relavent access rights too

bzr revid: ach@tinyerp.com-20100511083033-gbpbgiaopyesfzvv
parent 24069b2f
No related branches found
No related tags found
No related merge requests found
......@@ -286,7 +286,7 @@ class ir_model_access(osv.osv):
_columns = {
'name': fields.char('Name', size=64, required=True),
'model_id': fields.many2one('ir.model', 'Object', required=True),
'group_id': fields.many2one('res.groups', 'Group'),
'group_id': fields.many2one('res.groups', 'Group', ondelete='cascade'),
'perm_read': fields.boolean('Read Access'),
'perm_write': fields.boolean('Write Access'),
'perm_create': fields.boolean('Create Access'),
......
......@@ -430,6 +430,13 @@ class groups2(osv.osv): ##FIXME: Is there a reason to inherit this object ?
_columns = {
'users': fields.many2many('res.users', 'res_groups_users_rel', 'gid', 'uid', 'Users'),
}
def unlink(self, cr, uid, ids, context=None):
for record in self.read(cr, uid, ids, ['users'], context=context):
if record['users']:
raise osv.except_osv(_('Warning !'), _('Make sure you have no users linked with the group(s)!'))
return super(groups2, self).unlink(cr, uid, ids, context=context)
groups2()
class res_config_view(osv.osv_memory):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment