Exemplo n.º 1
0
    def recreateGroups(self, user):
        """
        Helper method, not needed to be overriden.
        It simply checks if the source is external and if so, recreates
        the user groups for storing them at database.

        user param is a database user object
        """
        if self.isExternalSource:
            groupsManager = GroupsManager(self._dbAuth)
            self.getGroups(user.name, groupsManager)
            user.groups.set([g.dbGroup() for g in groupsManager.getValidGroups()])
Exemplo n.º 2
0
    def recreateGroups(self, user):
        '''
        Helper method, not needed to be overriden.
        It simply checks if the source is external and if so, recreates
        the user groups for storing them at database.

        user param is a database user object
        '''
        if self.isExternalSource == True:
            groupsManager = GroupsManager(self._dbAuth)
            self.getGroups(user.name, groupsManager)
            user.groups = [g.dbGroup() for g in groupsManager.getValidGroups()]