Show More
@@ -75,7 +75,7 b' RhodeCode Features' | |||
|
75 | 75 | - Supports http/https, LDAP, AD, proxy-pass authentication. |
|
76 | 76 | - Full permissions (private/read/write/admin) together with IP restrictions for each repository, |
|
77 | 77 | additional explicit forking and repository creation permissions. |
|
78 |
- User |
|
|
78 | - User groups for easier permission management | |
|
79 | 79 | - Repository groups let you group repos and manage them easier. |
|
80 | 80 | - Users can fork other users repos, and compare them at any time. |
|
81 | 81 | - Integrates easily with other systems, with custom created mappers you can connect it to almost |
@@ -436,7 +436,7 b' OUTPUT::' | |||
|
436 | 436 | get_users_group |
|
437 | 437 | --------------- |
|
438 | 438 | |
|
439 |
Gets an existing user |
|
|
439 | Gets an existing user group. This command can be executed only using api_key | |
|
440 | 440 | belonging to user with admin rights. |
|
441 | 441 | |
|
442 | 442 | |
@@ -446,7 +446,7 b' INPUT::' | |||
|
446 | 446 | api_key : "<api_key>" |
|
447 | 447 | method : "get_users_group" |
|
448 | 448 | args : { |
|
449 |
"usersgroupid" : "<user |
|
|
449 | "usersgroupid" : "<user group id or name>" | |
|
450 | 450 | } |
|
451 | 451 | |
|
452 | 452 | OUTPUT:: |
@@ -479,7 +479,7 b' OUTPUT::' | |||
|
479 | 479 | get_users_groups |
|
480 | 480 | ---------------- |
|
481 | 481 | |
|
482 |
Lists all existing user |
|
|
482 | Lists all existing user groups. This command can be executed only using | |
|
483 | 483 | api_key belonging to user with admin rights. |
|
484 | 484 | |
|
485 | 485 | |
@@ -507,7 +507,7 b' OUTPUT::' | |||
|
507 | 507 | create_users_group |
|
508 | 508 | ------------------ |
|
509 | 509 | |
|
510 |
Creates new user |
|
|
510 | Creates new user group. This command can be executed only using api_key | |
|
511 | 511 | belonging to user with admin rights |
|
512 | 512 | |
|
513 | 513 | |
@@ -525,7 +525,7 b' OUTPUT::' | |||
|
525 | 525 | |
|
526 | 526 | id : <id_given_in_input> |
|
527 | 527 | result: { |
|
528 |
"msg": "created new user |
|
|
528 | "msg": "created new user group `<groupname>`", | |
|
529 | 529 | "users_group": { |
|
530 | 530 | "users_group_id" : "<id>", |
|
531 | 531 | "group_name" : "<groupname>", |
@@ -538,7 +538,7 b' OUTPUT::' | |||
|
538 | 538 | add_user_to_users_group |
|
539 | 539 | ----------------------- |
|
540 | 540 | |
|
541 |
Adds a user to a user |
|
|
541 | Adds a user to a user group. If user exists in that group success will be | |
|
542 | 542 | `false`. This command can be executed only using api_key |
|
543 | 543 | belonging to user with admin rights |
|
544 | 544 | |
@@ -549,7 +549,7 b' INPUT::' | |||
|
549 | 549 | api_key : "<api_key>" |
|
550 | 550 | method : "add_user_users_group" |
|
551 | 551 | args: { |
|
552 |
"usersgroupid" : "<user |
|
|
552 | "usersgroupid" : "<user group id or name>", | |
|
553 | 553 | "userid" : "<user_id or username>", |
|
554 | 554 | } |
|
555 | 555 | |
@@ -558,7 +558,7 b' OUTPUT::' | |||
|
558 | 558 | id : <id_given_in_input> |
|
559 | 559 | result: { |
|
560 | 560 | "success": True|False # depends on if member is in group |
|
561 |
"msg": "added member `<username>` to user |
|
|
561 | "msg": "added member `<username>` to user group `<groupname>` | | |
|
562 | 562 | User is already in that group" |
|
563 | 563 | } |
|
564 | 564 | error: null |
@@ -567,7 +567,7 b' OUTPUT::' | |||
|
567 | 567 | remove_user_from_users_group |
|
568 | 568 | ---------------------------- |
|
569 | 569 | |
|
570 |
Removes a user from a user |
|
|
570 | Removes a user from a user group. If user is not in given group success will | |
|
571 | 571 | be `false`. This command can be executed only |
|
572 | 572 | using api_key belonging to user with admin rights |
|
573 | 573 | |
@@ -578,7 +578,7 b' INPUT::' | |||
|
578 | 578 | api_key : "<api_key>" |
|
579 | 579 | method : "remove_user_from_users_group" |
|
580 | 580 | args: { |
|
581 |
"usersgroupid" : "<user |
|
|
581 | "usersgroupid" : "<user group id or name>", | |
|
582 | 582 | "userid" : "<user_id or username>", |
|
583 | 583 | } |
|
584 | 584 | |
@@ -587,7 +587,7 b' OUTPUT::' | |||
|
587 | 587 | id : <id_given_in_input> |
|
588 | 588 | result: { |
|
589 | 589 | "success": True|False, # depends on if member is in group |
|
590 |
"msg": "removed member <username> from user |
|
|
590 | "msg": "removed member <username> from user group <groupname> | | |
|
591 | 591 | User wasn't in group" |
|
592 | 592 | } |
|
593 | 593 | error: null |
@@ -929,7 +929,7 b' OUTPUT::' | |||
|
929 | 929 | grant_users_group_permission |
|
930 | 930 | ---------------------------- |
|
931 | 931 | |
|
932 |
Grant permission for user |
|
|
932 | Grant permission for user group on given repository, or update | |
|
933 | 933 | existing one if found. This command can be executed only using |
|
934 | 934 | api_key belonging to user with admin rights. |
|
935 | 935 | |
@@ -941,7 +941,7 b' INPUT::' | |||
|
941 | 941 | method : "grant_users_group_permission" |
|
942 | 942 | args: { |
|
943 | 943 | "repoid" : "<reponame or repo_id>" |
|
944 |
"usersgroupid" : "<user |
|
|
944 | "usersgroupid" : "<user group id or name>" | |
|
945 | 945 | "perm" : "(repository.(none|read|write|admin))", |
|
946 | 946 | } |
|
947 | 947 | |
@@ -958,7 +958,7 b' OUTPUT::' | |||
|
958 | 958 | revoke_users_group_permission |
|
959 | 959 | ----------------------------- |
|
960 | 960 | |
|
961 |
Revoke permission for user |
|
|
961 | Revoke permission for user group on given repository.This command can be | |
|
962 | 962 | executed only using api_key belonging to user with admin rights. |
|
963 | 963 | |
|
964 | 964 | INPUT:: |
@@ -968,7 +968,7 b' INPUT::' | |||
|
968 | 968 | method : "revoke_users_group_permission" |
|
969 | 969 | args: { |
|
970 | 970 | "repoid" : "<reponame or repo_id>" |
|
971 |
"usersgroupid" : "<user |
|
|
971 | "usersgroupid" : "<user group id or name>" | |
|
972 | 972 | } |
|
973 | 973 | |
|
974 | 974 | OUTPUT:: |
@@ -196,7 +196,7 b' news' | |||
|
196 | 196 | fixes |
|
197 | 197 | +++++ |
|
198 | 198 | |
|
199 |
- fixed #570 explicit user |
|
|
199 | - fixed #570 explicit user group permissions can overwrite owner permissions | |
|
200 | 200 | - fixed #578 set proper PATH with current Python for Git |
|
201 | 201 | hooks to execute within same Python as RhodeCode |
|
202 | 202 | - fixed issue with Git bare repos that ends with .git in name |
@@ -385,7 +385,7 b' news' | |||
|
385 | 385 | - created rcextensions module with additional mappings (ref #322) and |
|
386 | 386 | post push/pull/create repo hooks callbacks |
|
387 | 387 | - implemented #377 Users view for his own permissions on account page |
|
388 |
- #399 added inheritance of permissions for user |
|
|
388 | - #399 added inheritance of permissions for user group on repos groups | |
|
389 | 389 | - #401 repository group is automatically pre-selected when adding repos |
|
390 | 390 | inside a repository group |
|
391 | 391 | - added alternative HTTP 403 response when client failed to authenticate. Helps |
@@ -654,7 +654,7 b' news' | |||
|
654 | 654 | - implemented #93 customizable changelog on combined revision ranges - |
|
655 | 655 | equivalent of githubs compare view |
|
656 | 656 | - implemented #108 extended and more powerful LDAP configuration |
|
657 |
- implemented #56 user |
|
|
657 | - implemented #56 user groups | |
|
658 | 658 | - major code rewrites optimized codes for speed and memory usage |
|
659 | 659 | - raw and diff downloads are now in git format |
|
660 | 660 | - setup command checks for write access to given path |
@@ -235,7 +235,7 b' def make_map(config):' | |||
|
235 | 235 | m.connect("user_ips_delete", "/users_ips/{id}", |
|
236 | 236 | action="delete_ip", conditions=dict(method=["DELETE"])) |
|
237 | 237 | |
|
238 |
#ADMIN USER |
|
|
238 | #ADMIN USER GROUPS REST ROUTES | |
|
239 | 239 | with rmap.submapper(path_prefix=ADMIN_PREFIX, |
|
240 | 240 | controller='admin/users_groups') as m: |
|
241 | 241 | m.connect("users_groups", "/users_groups", |
@@ -345,7 +345,7 b' class ReposController(BaseRepoController' | |||
|
345 | 345 | @HasRepoPermissionAllDecorator('repository.admin') |
|
346 | 346 | def delete_perm_users_group(self, repo_name): |
|
347 | 347 | """ |
|
348 |
DELETE an existing repository permission user |
|
|
348 | DELETE an existing repository permission user group | |
|
349 | 349 | |
|
350 | 350 | :param repo_name: |
|
351 | 351 | """ |
@@ -358,7 +358,7 b' class ReposController(BaseRepoController' | |||
|
358 | 358 | except Exception: |
|
359 | 359 | log.error(traceback.format_exc()) |
|
360 | 360 | h.flash(_('An error occurred during deletion of repository' |
|
361 |
' user |
|
|
361 | ' user groups'), | |
|
362 | 362 | category='error') |
|
363 | 363 | raise HTTPInternalServerError() |
|
364 | 364 |
@@ -3,7 +3,7 b'' | |||
|
3 | 3 | rhodecode.controllers.admin.repos_groups |
|
4 | 4 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
|
5 | 5 | |
|
6 |
Repositor |
|
|
6 | Repository groups controller for RhodeCode | |
|
7 | 7 | |
|
8 | 8 | :created_on: Mar 23, 2010 |
|
9 | 9 | :author: marcink |
@@ -282,7 +282,7 b' class ReposGroupsController(BaseControll' | |||
|
282 | 282 | @HasReposGroupPermissionAnyDecorator('group.admin') |
|
283 | 283 | def delete_repos_group_user_perm(self, group_name): |
|
284 | 284 | """ |
|
285 |
DELETE an existing repositor |
|
|
285 | DELETE an existing repository group permission user | |
|
286 | 286 | |
|
287 | 287 | :param group_name: |
|
288 | 288 | """ |
@@ -307,7 +307,7 b' class ReposGroupsController(BaseControll' | |||
|
307 | 307 | @HasReposGroupPermissionAnyDecorator('group.admin') |
|
308 | 308 | def delete_repos_group_users_group_perm(self, group_name): |
|
309 | 309 | """ |
|
310 |
DELETE an existing repositor |
|
|
310 | DELETE an existing repository group permission user group | |
|
311 | 311 | |
|
312 | 312 | :param group_name: |
|
313 | 313 | """ |
@@ -322,7 +322,7 b' class ReposGroupsController(BaseControll' | |||
|
322 | 322 | except Exception: |
|
323 | 323 | log.error(traceback.format_exc()) |
|
324 | 324 | h.flash(_('An error occurred during deletion of group' |
|
325 |
' user |
|
|
325 | ' user groups'), | |
|
326 | 326 | category='error') |
|
327 | 327 | raise HTTPInternalServerError() |
|
328 | 328 |
@@ -3,7 +3,7 b'' | |||
|
3 | 3 | rhodecode.controllers.admin.users_groups |
|
4 | 4 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
|
5 | 5 | |
|
6 |
User |
|
|
6 | User Groups crud controller for pylons | |
|
7 | 7 | |
|
8 | 8 | :created_on: Jan 25, 2011 |
|
9 | 9 | :author: marcink |
@@ -83,7 +83,7 b' class UsersGroupsController(BaseControll' | |||
|
83 | 83 | action_logger(self.rhodecode_user, |
|
84 | 84 | 'admin_created_users_group:%s' % gr, |
|
85 | 85 | None, self.ip_addr, self.sa) |
|
86 |
h.flash(_('created user |
|
|
86 | h.flash(_('created user group %s') % gr, category='success') | |
|
87 | 87 | Session().commit() |
|
88 | 88 | except formencode.Invalid, errors: |
|
89 | 89 | return htmlfill.render( |
@@ -94,7 +94,7 b' class UsersGroupsController(BaseControll' | |||
|
94 | 94 | encoding="UTF-8") |
|
95 | 95 | except Exception: |
|
96 | 96 | log.error(traceback.format_exc()) |
|
97 |
h.flash(_('error occurred during creation of user |
|
|
97 | h.flash(_('error occurred during creation of user group %s') \ | |
|
98 | 98 | % request.POST.get('users_group_name'), category='error') |
|
99 | 99 | |
|
100 | 100 | return redirect(url('users_groups')) |
@@ -161,7 +161,7 b' class UsersGroupsController(BaseControll' | |||
|
161 | 161 | action_logger(self.rhodecode_user, |
|
162 | 162 | 'admin_updated_users_group:%s' % gr, |
|
163 | 163 | None, self.ip_addr, self.sa) |
|
164 |
h.flash(_('updated user |
|
|
164 | h.flash(_('updated user group %s') % gr, category='success') | |
|
165 | 165 | Session().commit() |
|
166 | 166 | except formencode.Invalid, errors: |
|
167 | 167 | ug_model = UsersGroupModel() |
@@ -183,7 +183,7 b' class UsersGroupsController(BaseControll' | |||
|
183 | 183 | encoding="UTF-8") |
|
184 | 184 | except Exception: |
|
185 | 185 | log.error(traceback.format_exc()) |
|
186 |
h.flash(_('error occurred during update of user |
|
|
186 | h.flash(_('error occurred during update of user group %s') \ | |
|
187 | 187 | % request.POST.get('users_group_name'), category='error') |
|
188 | 188 | |
|
189 | 189 | return redirect(url('edit_users_group', id=id)) |
@@ -200,12 +200,12 b' class UsersGroupsController(BaseControll' | |||
|
200 | 200 | try: |
|
201 | 201 | UsersGroupModel().delete(usr_gr) |
|
202 | 202 | Session().commit() |
|
203 |
h.flash(_('successfully deleted user |
|
|
203 | h.flash(_('successfully deleted user group'), category='success') | |
|
204 | 204 | except UsersGroupsAssignedException, e: |
|
205 | 205 | h.flash(e, category='error') |
|
206 | 206 | except Exception: |
|
207 | 207 | log.error(traceback.format_exc()) |
|
208 |
h.flash(_('An error occurred during deletion of user |
|
|
208 | h.flash(_('An error occurred during deletion of user group'), | |
|
209 | 209 | category='error') |
|
210 | 210 | return redirect(url('users_groups')) |
|
211 | 211 | |
@@ -254,23 +254,23 b' class UsersGroupsController(BaseControll' | |||
|
254 | 254 | if grant_create_perm: |
|
255 | 255 | usersgroup_model.revoke_perm(id, 'hg.create.none') |
|
256 | 256 | usersgroup_model.grant_perm(id, 'hg.create.repository') |
|
257 |
h.flash(_("Granted 'repository create' permission to user |
|
|
257 | h.flash(_("Granted 'repository create' permission to user group"), | |
|
258 | 258 | category='success') |
|
259 | 259 | else: |
|
260 | 260 | usersgroup_model.revoke_perm(id, 'hg.create.repository') |
|
261 | 261 | usersgroup_model.grant_perm(id, 'hg.create.none') |
|
262 |
h.flash(_("Revoked 'repository create' permission to user |
|
|
262 | h.flash(_("Revoked 'repository create' permission to user group"), | |
|
263 | 263 | category='success') |
|
264 | 264 | |
|
265 | 265 | if grant_fork_perm: |
|
266 | 266 | usersgroup_model.revoke_perm(id, 'hg.fork.none') |
|
267 | 267 | usersgroup_model.grant_perm(id, 'hg.fork.repository') |
|
268 |
h.flash(_("Granted 'repository fork' permission to user |
|
|
268 | h.flash(_("Granted 'repository fork' permission to user group"), | |
|
269 | 269 | category='success') |
|
270 | 270 | else: |
|
271 | 271 | usersgroup_model.revoke_perm(id, 'hg.fork.repository') |
|
272 | 272 | usersgroup_model.grant_perm(id, 'hg.fork.none') |
|
273 |
h.flash(_("Revoked 'repository fork' permission to user |
|
|
273 | h.flash(_("Revoked 'repository fork' permission to user group"), | |
|
274 | 274 | category='success') |
|
275 | 275 | |
|
276 | 276 | Session().commit() |
@@ -121,13 +121,13 b' def get_repo_or_error(repoid):' | |||
|
121 | 121 | |
|
122 | 122 | def get_users_group_or_error(usersgroupid): |
|
123 | 123 | """ |
|
124 |
Get user |
|
|
124 | Get user group by id or name or return JsonRPCError if not found | |
|
125 | 125 | |
|
126 | 126 | :param userid: |
|
127 | 127 | """ |
|
128 | 128 | users_group = UsersGroupModel().get_group(usersgroupid) |
|
129 | 129 | if users_group is None: |
|
130 |
raise JSONRPCError('user |
|
|
130 | raise JSONRPCError('user group `%s` does not exist' % usersgroupid) | |
|
131 | 131 | return users_group |
|
132 | 132 | |
|
133 | 133 | |
@@ -449,7 +449,7 b' class ApiController(JSONRPCController):' | |||
|
449 | 449 | @HasPermissionAllDecorator('hg.admin') |
|
450 | 450 | def get_users_group(self, apiuser, usersgroupid): |
|
451 | 451 | """" |
|
452 |
Get user |
|
|
452 | Get user group by name or id | |
|
453 | 453 | |
|
454 | 454 | :param apiuser: |
|
455 | 455 | :param usersgroupid: |
@@ -468,7 +468,7 b' class ApiController(JSONRPCController):' | |||
|
468 | 468 | @HasPermissionAllDecorator('hg.admin') |
|
469 | 469 | def get_users_groups(self, apiuser): |
|
470 | 470 | """" |
|
471 |
Get all user |
|
|
471 | Get all user groups | |
|
472 | 472 | |
|
473 | 473 | :param apiuser: |
|
474 | 474 | """ |
@@ -489,14 +489,14 b' class ApiController(JSONRPCController):' | |||
|
489 | 489 | """ |
|
490 | 490 | |
|
491 | 491 | if UsersGroupModel().get_by_name(group_name): |
|
492 |
raise JSONRPCError("user |
|
|
492 | raise JSONRPCError("user group `%s` already exist" % group_name) | |
|
493 | 493 | |
|
494 | 494 | try: |
|
495 | 495 | active = Optional.extract(active) |
|
496 | 496 | ug = UsersGroupModel().create(name=group_name, active=active) |
|
497 | 497 | Session().commit() |
|
498 | 498 | return dict( |
|
499 |
msg='created new user |
|
|
499 | msg='created new user group `%s`' % group_name, | |
|
500 | 500 | users_group=ug.get_api_data() |
|
501 | 501 | ) |
|
502 | 502 | except Exception: |
@@ -506,7 +506,7 b' class ApiController(JSONRPCController):' | |||
|
506 | 506 | @HasPermissionAllDecorator('hg.admin') |
|
507 | 507 | def add_user_to_users_group(self, apiuser, usersgroupid, userid): |
|
508 | 508 | """" |
|
509 |
Add a user to a user |
|
|
509 | Add a user to a user group | |
|
510 | 510 | |
|
511 | 511 | :param apiuser: |
|
512 | 512 | :param usersgroupid: |
@@ -518,7 +518,7 b' class ApiController(JSONRPCController):' | |||
|
518 | 518 | try: |
|
519 | 519 | ugm = UsersGroupModel().add_user_to_group(users_group, user) |
|
520 | 520 | success = True if ugm != True else False |
|
521 |
msg = 'added member `%s` to user |
|
|
521 | msg = 'added member `%s` to user group `%s`' % ( | |
|
522 | 522 | user.username, users_group.users_group_name |
|
523 | 523 | ) |
|
524 | 524 | msg = msg if success else 'User is already in that group' |
@@ -531,7 +531,7 b' class ApiController(JSONRPCController):' | |||
|
531 | 531 | except Exception: |
|
532 | 532 | log.error(traceback.format_exc()) |
|
533 | 533 | raise JSONRPCError( |
|
534 |
'failed to add member to user |
|
|
534 | 'failed to add member to user group `%s`' % ( | |
|
535 | 535 | users_group.users_group_name |
|
536 | 536 | ) |
|
537 | 537 | ) |
@@ -551,7 +551,7 b' class ApiController(JSONRPCController):' | |||
|
551 | 551 | try: |
|
552 | 552 | success = UsersGroupModel().remove_user_from_group(users_group, |
|
553 | 553 | user) |
|
554 |
msg = 'removed member `%s` from user |
|
|
554 | msg = 'removed member `%s` from user group `%s`' % ( | |
|
555 | 555 | user.username, users_group.users_group_name |
|
556 | 556 | ) |
|
557 | 557 | msg = msg if success else "User wasn't in group" |
@@ -560,7 +560,7 b' class ApiController(JSONRPCController):' | |||
|
560 | 560 | except Exception: |
|
561 | 561 | log.error(traceback.format_exc()) |
|
562 | 562 | raise JSONRPCError( |
|
563 |
'failed to remove member from user |
|
|
563 | 'failed to remove member from user group `%s`' % ( | |
|
564 | 564 | users_group.users_group_name |
|
565 | 565 | ) |
|
566 | 566 | ) |
@@ -890,7 +890,7 b' class ApiController(JSONRPCController):' | |||
|
890 | 890 | def grant_users_group_permission(self, apiuser, repoid, usersgroupid, |
|
891 | 891 | perm): |
|
892 | 892 | """ |
|
893 |
Grant permission for user |
|
|
893 | Grant permission for user group on given repository, or update | |
|
894 | 894 | existing one if found |
|
895 | 895 | |
|
896 | 896 | :param apiuser: |
@@ -909,7 +909,7 b' class ApiController(JSONRPCController):' | |||
|
909 | 909 | |
|
910 | 910 | Session().commit() |
|
911 | 911 | return dict( |
|
912 |
msg='Granted perm: `%s` for user |
|
|
912 | msg='Granted perm: `%s` for user group: `%s` in ' | |
|
913 | 913 | 'repo: `%s`' % ( |
|
914 | 914 | perm.permission_name, users_group.users_group_name, |
|
915 | 915 | repo.repo_name |
@@ -919,7 +919,7 b' class ApiController(JSONRPCController):' | |||
|
919 | 919 | except Exception: |
|
920 | 920 | log.error(traceback.format_exc()) |
|
921 | 921 | raise JSONRPCError( |
|
922 |
'failed to edit permission for user |
|
|
922 | 'failed to edit permission for user group: `%s` in ' | |
|
923 | 923 | 'repo: `%s`' % ( |
|
924 | 924 | usersgroupid, repo.repo_name |
|
925 | 925 | ) |
@@ -928,7 +928,7 b' class ApiController(JSONRPCController):' | |||
|
928 | 928 | @HasPermissionAllDecorator('hg.admin') |
|
929 | 929 | def revoke_users_group_permission(self, apiuser, repoid, usersgroupid): |
|
930 | 930 | """ |
|
931 |
Revoke permission for user |
|
|
931 | Revoke permission for user group on given repository | |
|
932 | 932 | |
|
933 | 933 | :param apiuser: |
|
934 | 934 | :param repoid: |
@@ -943,7 +943,7 b' class ApiController(JSONRPCController):' | |||
|
943 | 943 | |
|
944 | 944 | Session().commit() |
|
945 | 945 | return dict( |
|
946 |
msg='Revoked perm for user |
|
|
946 | msg='Revoked perm for user group: `%s` in repo: `%s`' % ( | |
|
947 | 947 | users_group.users_group_name, repo.repo_name |
|
948 | 948 | ), |
|
949 | 949 | success=True |
@@ -951,7 +951,7 b' class ApiController(JSONRPCController):' | |||
|
951 | 951 | except Exception: |
|
952 | 952 | log.error(traceback.format_exc()) |
|
953 | 953 | raise JSONRPCError( |
|
954 |
'failed to edit permission for user |
|
|
954 | 'failed to edit permission for user group: `%s` in ' | |
|
955 | 955 | 'repo: `%s`' % ( |
|
956 | 956 | users_group.users_group_name, repo.repo_name |
|
957 | 957 | ) |
@@ -3,7 +3,7 b'' | |||
|
3 | 3 | rhodecode.model.user_group |
|
4 | 4 | ~~~~~~~~~~~~~~~~~~~~~~~~~~ |
|
5 | 5 | |
|
6 |
|
|
|
6 | repo group model for RhodeCode | |
|
7 | 7 | |
|
8 | 8 | :created_on: Jan 25, 2011 |
|
9 | 9 | :author: marcink |
@@ -218,7 +218,7 b' class ReposGroupModel(BaseModel):' | |||
|
218 | 218 | if member_type == 'user': |
|
219 | 219 | # this updates also current one if found |
|
220 | 220 | _set_perm_user(obj, user=member, perm=perm) |
|
221 |
## set for user |
|
|
221 | ## set for user group | |
|
222 | 222 | else: |
|
223 | 223 | _set_perm_group(obj, users_group=member, perm=perm) |
|
224 | 224 | # set new permissions |
@@ -289,11 +289,11 b' class ReposGroupModel(BaseModel):' | |||
|
289 | 289 | def delete_permission(self, repos_group, obj, obj_type, recursive): |
|
290 | 290 | """ |
|
291 | 291 | Revokes permission for repos_group for given obj(user or users_group), |
|
292 |
obj_type can be user or user |
|
|
292 | obj_type can be user or user group | |
|
293 | 293 | |
|
294 | 294 | :param repos_group: |
|
295 |
:param obj: user or user |
|
|
296 |
:param obj_type: user or user |
|
|
295 | :param obj: user or user group id | |
|
296 | :param obj_type: user or user group type | |
|
297 | 297 | :param recursive: recurse to all children of group |
|
298 | 298 | """ |
|
299 | 299 | from rhodecode.model.repo import RepoModel |
@@ -376,13 +376,13 b' class ReposGroupModel(BaseModel):' | |||
|
376 | 376 | |
|
377 | 377 | def grant_users_group_permission(self, repos_group, group_name, perm): |
|
378 | 378 | """ |
|
379 |
Grant permission for user |
|
|
379 | Grant permission for user group on given repositories group, or update | |
|
380 | 380 | existing one if found |
|
381 | 381 | |
|
382 | 382 | :param repos_group: Instance of ReposGroup, repositories_group_id, |
|
383 | 383 | or repositories_group name |
|
384 | 384 | :param group_name: Instance of UserGroup, users_group_id, |
|
385 |
or user |
|
|
385 | or user group name | |
|
386 | 386 | :param perm: Instance of Permission, or permission_name |
|
387 | 387 | """ |
|
388 | 388 | repos_group = self._get_repos_group(repos_group) |
@@ -407,12 +407,12 b' class ReposGroupModel(BaseModel):' | |||
|
407 | 407 | |
|
408 | 408 | def revoke_users_group_permission(self, repos_group, group_name): |
|
409 | 409 | """ |
|
410 |
Revoke permission for user |
|
|
410 | Revoke permission for user group on given repositories group | |
|
411 | 411 | |
|
412 | 412 | :param repos_group: Instance of ReposGroup, repositories_group_id, |
|
413 | 413 | or repositories_group name |
|
414 | 414 | :param group_name: Instance of UserGroup, users_group_id, |
|
415 |
or user |
|
|
415 | or user group name | |
|
416 | 416 | """ |
|
417 | 417 | repos_group = self._get_repos_group(repos_group) |
|
418 | 418 | group_name = self.__get_users_group(group_name) |
@@ -464,7 +464,7 b' class UserModel(BaseModel):' | |||
|
464 | 464 | p = 'repository.admin' |
|
465 | 465 | user.permissions[RK][r_k] = p |
|
466 | 466 | |
|
467 |
# repositor |
|
|
467 | # repository groups | |
|
468 | 468 | for perm in default_repo_groups_perms: |
|
469 | 469 | rg_k = perm.UserRepoGroupToPerm.group.group_name |
|
470 | 470 | p = 'group.admin' |
@@ -497,7 +497,7 b' class UserModel(BaseModel):' | |||
|
497 | 497 | |
|
498 | 498 | user.permissions[RK][r_k] = p |
|
499 | 499 | |
|
500 |
# defaults for repositor |
|
|
500 | # defaults for repository groups taken from default user permission | |
|
501 | 501 | # on given group |
|
502 | 502 | for perm in default_repo_groups_perms: |
|
503 | 503 | rg_k = perm.UserRepoGroupToPerm.group.group_name |
@@ -610,7 +610,7 b' class UserModel(BaseModel):' | |||
|
610 | 610 | user.permissions[RK][r_k] = p |
|
611 | 611 | |
|
612 | 612 | #====================================================================== |
|
613 |
# !! PERMISSIONS FOR REPOSITOR |
|
|
613 | # !! PERMISSIONS FOR REPOSITORY GROUPS !! | |
|
614 | 614 | #====================================================================== |
|
615 | 615 | #====================================================================== |
|
616 | 616 | # check if user is part of user groups for this repository groups and |
@@ -3,7 +3,7 b'' | |||
|
3 | 3 | rhodecode.model.users_group |
|
4 | 4 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
|
5 | 5 | |
|
6 |
user |
|
|
6 | user group model for RhodeCode | |
|
7 | 7 | |
|
8 | 8 | :created_on: Oct 1, 2011 |
|
9 | 9 | :author: nvinot |
@@ -38,7 +38,7 b'' | |||
|
38 | 38 | %endif |
|
39 | 39 | %endfor |
|
40 | 40 | |
|
41 |
## USER |
|
|
41 | ## USER GROUPS | |
|
42 | 42 | %for g2p in c.repo_info.users_group_to_perm: |
|
43 | 43 | <tr id="id${id(g2p.users_group.users_group_name)}"> |
|
44 | 44 | <td>${h.radio('g_perm_%s' % g2p.users_group.users_group_name,'repository.none')}</td> |
@@ -109,7 +109,7 b' function ajaxActionUsersGroup(users_grou' | |||
|
109 | 109 | tr.parentNode.removeChild(tr); |
|
110 | 110 | }, |
|
111 | 111 | failure:function(o){ |
|
112 |
alert("${_('Failed to remove user |
|
|
112 | alert("${_('Failed to remove user group')}"); | |
|
113 | 113 | }, |
|
114 | 114 | }; |
|
115 | 115 | var postData = '_method=delete&users_group_id='+users_group_id; |
@@ -40,7 +40,7 b'' | |||
|
40 | 40 | </tr> |
|
41 | 41 | %endfor |
|
42 | 42 | |
|
43 |
## USER |
|
|
43 | ## USER GROUPS | |
|
44 | 44 | %for g2p in c.repos_group.users_group_to_perm: |
|
45 | 45 | <tr id="id${id(g2p.users_group.users_group_name)}"> |
|
46 | 46 | <td>${h.radio('g_perm_%s' % g2p.users_group.users_group_name,'group.none')}</td> |
@@ -113,7 +113,7 b' function ajaxActionUsersGroup(users_grou' | |||
|
113 | 113 | tr.parentNode.removeChild(tr); |
|
114 | 114 | }, |
|
115 | 115 | failure:function(o){ |
|
116 |
alert("${_('Failed to remove user |
|
|
116 | alert("${_('Failed to remove user group')}"); | |
|
117 | 117 | }, |
|
118 | 118 | }; |
|
119 | 119 | var recursive = YUD.get('recursive').checked; |
@@ -2,7 +2,7 b'' | |||
|
2 | 2 | <%inherit file="/base/base.html"/> |
|
3 | 3 | |
|
4 | 4 | <%def name="title()"> |
|
5 |
${_('Repositor |
|
|
5 | ${_('Repository groups administration')} - ${c.rhodecode_name} | |
|
6 | 6 | </%def> |
|
7 | 7 | |
|
8 | 8 | |
@@ -48,7 +48,7 b'' | |||
|
48 | 48 | <tr> |
|
49 | 49 | <td> |
|
50 | 50 | <div style="white-space: nowrap"> |
|
51 |
<img class="icon" alt="${_('Repositor |
|
|
51 | <img class="icon" alt="${_('Repository group')}" src="${h.url('/images/icons/database_link.png')}"/> | |
|
52 | 52 | ${h.link_to(h.literal(' » '.join(map(h.safe_unicode,[g.name for g in gr.parents+[gr]]))), url('repos_group_home',group_name=gr.group_name))} |
|
53 | 53 | </div> |
|
54 | 54 | </td> |
@@ -69,7 +69,7 b'' | |||
|
69 | 69 | |
|
70 | 70 | </table> |
|
71 | 71 | % else: |
|
72 |
${_('There are no repositor |
|
|
72 | ${_('There are no repository groups yet')} | |
|
73 | 73 | % endif |
|
74 | 74 | |
|
75 | 75 | </div> |
@@ -2,14 +2,14 b'' | |||
|
2 | 2 | <%inherit file="/base/base.html"/> |
|
3 | 3 | |
|
4 | 4 | <%def name="title()"> |
|
5 |
${_('Add user |
|
|
5 | ${_('Add user group')} - ${c.rhodecode_name} | |
|
6 | 6 | </%def> |
|
7 | 7 | <%def name="breadcrumbs_links()"> |
|
8 | 8 | ${h.link_to(_('Admin'),h.url('admin_home'))} |
|
9 | 9 | » |
|
10 |
${h.link_to(_('User |
|
|
10 | ${h.link_to(_('User groups'),h.url('users_groups'))} | |
|
11 | 11 | » |
|
12 |
${_('add new user |
|
|
12 | ${_('add new user group')} | |
|
13 | 13 | </%def> |
|
14 | 14 | |
|
15 | 15 | <%def name="page_nav()"> |
@@ -2,13 +2,13 b'' | |||
|
2 | 2 | <%inherit file="/base/base.html"/> |
|
3 | 3 | |
|
4 | 4 | <%def name="title()"> |
|
5 |
${_('User |
|
|
5 | ${_('User groups administration')} - ${c.rhodecode_name} | |
|
6 | 6 | </%def> |
|
7 | 7 | |
|
8 | 8 | <%def name="breadcrumbs_links()"> |
|
9 | 9 | ${h.link_to(_('Admin'),h.url('admin_home'))} |
|
10 | 10 | » |
|
11 |
${_('user |
|
|
11 | ${_('user groups')} | |
|
12 | 12 | </%def> |
|
13 | 13 | |
|
14 | 14 | <%def name="page_nav()"> |
@@ -44,7 +44,7 b'' | |||
|
44 | 44 | <td> |
|
45 | 45 | ${h.form(url('users_group', id=u_group.users_group_id),method='delete')} |
|
46 | 46 | ${h.submit('remove_',_('delete'),id="remove_group_%s" % u_group.users_group_id, |
|
47 |
class_="delete_icon action_button",onclick="return confirm('"+_('Confirm to delete this user |
|
|
47 | class_="delete_icon action_button",onclick="return confirm('"+_('Confirm to delete this user group: %s') % u_group.users_group_name+"');")} | |
|
48 | 48 | ${h.end_form()} |
|
49 | 49 | </td> |
|
50 | 50 | </tr> |
@@ -240,9 +240,9 b'' | |||
|
240 | 240 | <ul> |
|
241 | 241 | <li>${h.link_to(_('admin journal'),h.url('admin_home'),class_='journal')}</li> |
|
242 | 242 | <li>${h.link_to(_('repositories'),h.url('repos'),class_='repos')}</li> |
|
243 |
<li>${h.link_to(_('repositor |
|
|
243 | <li>${h.link_to(_('repository groups'),h.url('repos_groups'),class_='repos_groups')}</li> | |
|
244 | 244 | <li>${h.link_to(_('users'),h.url('users'),class_='users')}</li> |
|
245 |
<li>${h.link_to(_('user |
|
|
245 | <li>${h.link_to(_('user groups'),h.url('users_groups'),class_='groups')}</li> | |
|
246 | 246 | <li>${h.link_to(_('permissions'),h.url('edit_permission',id='default'),class_='permissions')}</li> |
|
247 | 247 | <li>${h.link_to(_('ldap'),h.url('ldap_home'),class_='ldap')}</li> |
|
248 | 248 | <li>${h.link_to(_('defaults'),h.url('defaults'),class_='defaults')}</li> |
@@ -258,7 +258,7 b'' | |||
|
258 | 258 | ${h.link_to(_('admin'),h.url('admin_home'),class_='admin')} |
|
259 | 259 | <%def name="admin_menu_simple()"> |
|
260 | 260 | <ul> |
|
261 |
<li>${h.link_to(_('repositor |
|
|
261 | <li>${h.link_to(_('repository groups'),h.url('repos_groups'),class_='repos_groups')}</li> | |
|
262 | 262 | </ul> |
|
263 | 263 | </%def> |
|
264 | 264 | ## ADMIN MENU |
@@ -6,7 +6,7 b' class TestReposGroupsController(TestCont' | |||
|
6 | 6 | def test_index(self): |
|
7 | 7 | self.log_user() |
|
8 | 8 | response = self.app.get(url('repos_groups')) |
|
9 |
response.mustcontain('There are no repositor |
|
|
9 | response.mustcontain('There are no repository groups yet') | |
|
10 | 10 | |
|
11 | 11 | # def test_index_as_xml(self): |
|
12 | 12 | # response = self.app.get(url('formatted_repos_groups', format='xml')) |
General Comments 0
You need to be logged in to leave comments.
Login now