Ignore:
Timestamp:
Apr 25, 2017, 5:20:11 PM (4 years ago)
Author:
mabarracus
Message:

Add disavow action to plugin users

File:
1 edited

Legend:

Unmodified
Added
Removed
  • syncer/trunk/fuentes/syncer.install/usr/lib/syncer/plugins/users.py

    r4039 r4428  
    3131                if g in current_grps:
    3232                    return True, 'User is in group ' + g
    33 
    34             return False,'Not in group'
     33            return False, 'Not in group'
     34        if (params['action']) == 'disavow_grp':
     35            grouplist=params['options']
     36            groups_to_apply=grouplist.split(',')
     37            current_grps=self.get_current_groups()
     38            for g in groups_to_apply:
     39                if g in current_grps:
     40                    return False, 'Not allowed for this group ' + g
     41            return True, 'User don\'t disavow condition {}'.format(grouplist)
    3542
    3643
    3744
     45
     46
Note: See TracChangeset for help on using the changeset viewer.