~azzar1/unity/add-show-desktop-key

« back to all changes in this revision

Viewing changes to scripts/usrmgt-server

  • Committer: dcoles
  • Date: 2008-08-07 06:46:32 UTC
  • Revision ID: svn-v3-trunk0:2b9c9e99-6f39-0410-b283-7f802c844ae2:trunk:989
Groups: Added userservice/assign_group call. This allows a user with the 
CAP_MANAGEGROUPS permission to assign a user into a group. This records the 
assignment in the database and then regenerates a svn-groups.conf file which 
specifies which users can access which repository.

This commit introduces the /groups repository (which means a groups directory 
will have to be created in repositories area and the apache config will have to 
be updated to allow the new dav repositories to work - see the changes to 
ivle-svn.conf/ivle-both.conf and install_proc for exact details). There is also 
a new parameter svn_group_conf in the config file so you need to run `setup.py 
config` too.

Show diffs side-by-side

added added

removed removed

Lines of Context:
55
55
        logging.debug("Creating user's Subversion repository")
56
56
        common.makeuser.make_svn_repo(repopath, throw_on_error=False)
57
57
 
58
 
        logging.debug("Rebuilding Subversion authorization config")
59
 
        try:
60
 
            common.makeuser.rebuild_svn_config()
61
 
        except:
62
 
            logging.warning('Rebuild of Subversion authorization config failed!')
 
58
        rebuild_svn_config(props)
63
59
 
64
60
        logging.debug("Adding Subversion authentication")
65
61
        passwd = common.makeuser.make_svn_auth(login, throw_on_error=False)
76
72
    finally:
77
73
        db.close()
78
74
 
 
75
def rebuild_svn_config(props):
 
76
    """Rebuilds the svn config file
 
77
    Return value:
 
78
        response (okay, failure)
 
79
    """
 
80
    try:
 
81
        common.makeuser.rebuild_svn_config()
 
82
    except Exception, e:
 
83
        logging.warning('Rebuild of Subversion authorization config failed!')
 
84
        return{'response': 'failure', 'msg': repr(e)}
 
85
 
 
86
    return {'response': 'okay'}
 
87
 
 
88
def rebuild_svn_group_config(props):
 
89
    """Rebuilds the svn group config file
 
90
    Return value:
 
91
        response (okay, failure)
 
92
    """
 
93
    try:
 
94
        common.makeuser.rebuild_svn_group_config()
 
95
    except Exception, e:
 
96
        logging.warning(
 
97
            'Rebuild of Subversion group authorization config failed!')
 
98
        return{'response': 'failure', 'msg': repr(e)}
 
99
 
 
100
    return {'response': 'okay'}
 
101
 
79
102
def create_group_repository(props):
80
103
    """Creates on disk repository for the given group
81
104
    Expected properties:
104
127
actions = {
105
128
        'activate_user':activate_user,
106
129
        'create_group_repository':create_group_repository,
 
130
        'rebuild_svn_config':rebuild_svn_config,
 
131
        'rebuild_svn_group_config':rebuild_svn_group_config,
107
132
    }
108
133
 
109
134
def initializer():