Show More
@@ -191,7 +191,6 b' OUTPUT::' | |||
|
191 | 191 | ... |
|
192 | 192 | ] |
|
193 | 193 | } |
|
194 | ||
|
195 | 194 | error : null |
|
196 | 195 | |
|
197 | 196 | get_user |
@@ -892,7 +891,6 b' INPUT::' | |||
|
892 | 891 | "copy_permissions": "<bool>", |
|
893 | 892 | "private": "<bool>", |
|
894 | 893 | "landing_rev": "<landing_rev>" |
|
895 | ||
|
896 | 894 | } |
|
897 | 895 | |
|
898 | 896 | OUTPUT:: |
@@ -186,9 +186,7 b' class ApiController(JSONRPCController):' | |||
|
186 | 186 | error : { |
|
187 | 187 | "Unable to pull changes from `<reponame>`" |
|
188 | 188 | } |
|
189 | ||
|
190 | 189 | """ |
|
191 | ||
|
192 | 190 | repo = get_repo_or_error(repoid) |
|
193 | 191 | |
|
194 | 192 | try: |
@@ -234,9 +232,7 b' class ApiController(JSONRPCController):' | |||
|
234 | 232 | error : { |
|
235 | 233 | 'Error occurred during rescan repositories action' |
|
236 | 234 | } |
|
237 | ||
|
238 | 235 | """ |
|
239 | ||
|
240 | 236 | try: |
|
241 | 237 | rm_obsolete = remove_obsolete |
|
242 | 238 | added, removed = repo2db_mapper(ScmModel().repo_scan(), |
@@ -273,7 +269,6 b' class ApiController(JSONRPCController):' | |||
|
273 | 269 | error : { |
|
274 | 270 | 'Error occurred during cache invalidation action' |
|
275 | 271 | } |
|
276 | ||
|
277 | 272 | """ |
|
278 | 273 | repo = get_repo_or_error(repoid) |
|
279 | 274 | if not HasPermissionAny('hg.admin')(): |
@@ -336,7 +331,6 b' class ApiController(JSONRPCController):' | |||
|
336 | 331 | """ |
|
337 | 332 | return server info, including Kallithea version and installed packages |
|
338 | 333 | |
|
339 | ||
|
340 | 334 | OUTPUT:: |
|
341 | 335 | |
|
342 | 336 | id : <id_given_in_input> |
@@ -385,9 +379,7 b' class ApiController(JSONRPCController):' | |||
|
385 | 379 | "user_groups": { "usrgrp1": "usergroup.admin" } |
|
386 | 380 | }, |
|
387 | 381 | } |
|
388 | ||
|
389 | 382 | error: null |
|
390 | ||
|
391 | 383 | """ |
|
392 | 384 | if not HasPermissionAny('hg.admin')(): |
|
393 | 385 | # make sure normal user does not pass someone else userid, |
@@ -411,14 +403,12 b' class ApiController(JSONRPCController):' | |||
|
411 | 403 | Lists all existing users. This command can be executed only using api_key |
|
412 | 404 | belonging to user with admin rights. |
|
413 | 405 | |
|
414 | ||
|
415 | 406 | OUTPUT:: |
|
416 | 407 | |
|
417 | 408 | id : <id_given_in_input> |
|
418 | 409 | result: [<user_object>, ...] |
|
419 | 410 | error: null |
|
420 | 411 | """ |
|
421 | ||
|
422 | 412 | return [ |
|
423 | 413 | user.get_api_data() |
|
424 | 414 | for user in db.User.query() |
@@ -455,7 +445,6 b' class ApiController(JSONRPCController):' | |||
|
455 | 445 | :param extern_type: extern_type |
|
456 | 446 | :type extern_type: Optional(str) |
|
457 | 447 | |
|
458 | ||
|
459 | 448 | OUTPUT:: |
|
460 | 449 | |
|
461 | 450 | id : <id_given_in_input> |
@@ -476,9 +465,7 b' class ApiController(JSONRPCController):' | |||
|
476 | 465 | or |
|
477 | 466 | "failed to create user `<username>`" |
|
478 | 467 | } |
|
479 | ||
|
480 | 468 | """ |
|
481 | ||
|
482 | 469 | if db.User.get_by_username(username): |
|
483 | 470 | raise JSONRPCError("user `%s` already exist" % (username,)) |
|
484 | 471 | |
@@ -537,7 +524,6 b' class ApiController(JSONRPCController):' | |||
|
537 | 524 | :param extern_type: |
|
538 | 525 | :type extern_type: Optional(str) |
|
539 | 526 | |
|
540 | ||
|
541 | 527 | OUTPUT:: |
|
542 | 528 | |
|
543 | 529 | id : <id_given_in_input> |
@@ -554,9 +540,7 b' class ApiController(JSONRPCController):' | |||
|
554 | 540 | error : { |
|
555 | 541 | "failed to update user `<username>`" |
|
556 | 542 | } |
|
557 | ||
|
558 | 543 | """ |
|
559 | ||
|
560 | 544 | user = get_user_or_error(userid) |
|
561 | 545 | |
|
562 | 546 | # only non optional arguments will be stored in updates |
@@ -612,7 +596,6 b' class ApiController(JSONRPCController):' | |||
|
612 | 596 | error : { |
|
613 | 597 | "failed to delete user ID:<userid> <username>" |
|
614 | 598 | } |
|
615 | ||
|
616 | 599 | """ |
|
617 | 600 | user = get_user_or_error(userid) |
|
618 | 601 | |
@@ -652,7 +635,6 b' class ApiController(JSONRPCController):' | |||
|
652 | 635 | "members" : [<user_obj>,...] |
|
653 | 636 | } |
|
654 | 637 | error : null |
|
655 | ||
|
656 | 638 | """ |
|
657 | 639 | user_group = get_user_group_or_error(usergroupid) |
|
658 | 640 | if not HasPermissionAny('hg.admin')(): |
@@ -669,14 +651,12 b' class ApiController(JSONRPCController):' | |||
|
669 | 651 | api_key belonging to user with admin rights or user who has at least |
|
670 | 652 | read access to user group. |
|
671 | 653 | |
|
672 | ||
|
673 | 654 | OUTPUT:: |
|
674 | 655 | |
|
675 | 656 | id : <id_given_in_input> |
|
676 | 657 | result : [<user_group_obj>,...] |
|
677 | 658 | error : null |
|
678 | 659 | """ |
|
679 | ||
|
680 | 660 | return [ |
|
681 | 661 | user_group.get_api_data() |
|
682 | 662 | for user_group in UserGroupList(db.UserGroup.query().all(), perm_level='read') |
@@ -717,9 +697,7 b' class ApiController(JSONRPCController):' | |||
|
717 | 697 | or |
|
718 | 698 | "failed to create group `<group name>`" |
|
719 | 699 | } |
|
720 | ||
|
721 | 700 | """ |
|
722 | ||
|
723 | 701 | if UserGroupModel().get_by_name(group_name): |
|
724 | 702 | raise JSONRPCError("user group `%s` already exist" % (group_name,)) |
|
725 | 703 | |
@@ -774,7 +752,6 b' class ApiController(JSONRPCController):' | |||
|
774 | 752 | error : { |
|
775 | 753 | "failed to update user group `<user group name>`" |
|
776 | 754 | } |
|
777 | ||
|
778 | 755 | """ |
|
779 | 756 | user_group = get_user_group_or_error(usergroupid) |
|
780 | 757 | if not HasPermissionAny('hg.admin')(): |
@@ -828,7 +805,6 b' class ApiController(JSONRPCController):' | |||
|
828 | 805 | or |
|
829 | 806 | "RepoGroup assigned to <repo_groups_list>" |
|
830 | 807 | } |
|
831 | ||
|
832 | 808 | """ |
|
833 | 809 | user_group = get_user_group_or_error(usergroupid) |
|
834 | 810 | if not HasPermissionAny('hg.admin')(): |
@@ -872,7 +848,6 b' class ApiController(JSONRPCController):' | |||
|
872 | 848 | "success": True|False # depends on if member is in group |
|
873 | 849 | "msg": "added member `<username>` to a user group `<groupname>` | |
|
874 | 850 | User is already in that group" |
|
875 | ||
|
876 | 851 | } |
|
877 | 852 | error : null |
|
878 | 853 | |
@@ -883,7 +858,6 b' class ApiController(JSONRPCController):' | |||
|
883 | 858 | error : { |
|
884 | 859 | "failed to add member to user group `<user_group_name>`" |
|
885 | 860 | } |
|
886 | ||
|
887 | 861 | """ |
|
888 | 862 | user = get_user_or_error(userid) |
|
889 | 863 | user_group = get_user_group_or_error(usergroupid) |
@@ -922,7 +896,6 b' class ApiController(JSONRPCController):' | |||
|
922 | 896 | :param usergroupid: |
|
923 | 897 | :param userid: |
|
924 | 898 | |
|
925 | ||
|
926 | 899 | OUTPUT:: |
|
927 | 900 | |
|
928 | 901 | id : <id_given_in_input> |
@@ -932,7 +905,6 b' class ApiController(JSONRPCController):' | |||
|
932 | 905 | User wasn't in group" |
|
933 | 906 | } |
|
934 | 907 | error: null |
|
935 | ||
|
936 | 908 | """ |
|
937 | 909 | user = get_user_or_error(userid) |
|
938 | 910 | user_group = get_user_group_or_error(usergroupid) |
@@ -1023,7 +995,6 b' class ApiController(JSONRPCController):' | |||
|
1023 | 995 | }, |
|
1024 | 996 | } |
|
1025 | 997 | error : null |
|
1026 | ||
|
1027 | 998 | """ |
|
1028 | 999 | repo = get_repo_or_error(repoid) |
|
1029 | 1000 | |
@@ -1070,7 +1041,6 b' class ApiController(JSONRPCController):' | |||
|
1070 | 1041 | api_key belonging to user with admin rights or regular user that have |
|
1071 | 1042 | admin, write or read access to repository. |
|
1072 | 1043 | |
|
1073 | ||
|
1074 | 1044 | OUTPUT:: |
|
1075 | 1045 | |
|
1076 | 1046 | id : <id_given_in_input> |
@@ -1121,7 +1091,6 b' class ApiController(JSONRPCController):' | |||
|
1121 | 1091 | :param ret_type: return type 'all|files|dirs' nodes |
|
1122 | 1092 | :type ret_type: Optional(str) |
|
1123 | 1093 | |
|
1124 | ||
|
1125 | 1094 | OUTPUT:: |
|
1126 | 1095 | |
|
1127 | 1096 | id : <id_given_in_input> |
@@ -1213,7 +1182,6 b' class ApiController(JSONRPCController):' | |||
|
1213 | 1182 | error : { |
|
1214 | 1183 | 'failed to create repository `<repo_name>` |
|
1215 | 1184 | } |
|
1216 | ||
|
1217 | 1185 | """ |
|
1218 | 1186 | group_name = None |
|
1219 | 1187 | repo_name_parts = repo_name.split('/') |
@@ -1287,7 +1255,6 b' class ApiController(JSONRPCController):' | |||
|
1287 | 1255 | clone_uri=None, landing_rev=None, |
|
1288 | 1256 | enable_statistics=None, |
|
1289 | 1257 | enable_downloads=None): |
|
1290 | ||
|
1291 | 1258 | """ |
|
1292 | 1259 | Updates repo |
|
1293 | 1260 | |
@@ -1393,7 +1360,6 b' class ApiController(JSONRPCController):' | |||
|
1393 | 1360 | "success": true |
|
1394 | 1361 | } |
|
1395 | 1362 | error: null |
|
1396 | ||
|
1397 | 1363 | """ |
|
1398 | 1364 | repo = get_repo_or_error(repoid) |
|
1399 | 1365 | repo_name = repo.repo_name |
@@ -1481,7 +1447,6 b' class ApiController(JSONRPCController):' | |||
|
1481 | 1447 | "success": true |
|
1482 | 1448 | } |
|
1483 | 1449 | error: null |
|
1484 | ||
|
1485 | 1450 | """ |
|
1486 | 1451 | repo = get_repo_or_error(repoid) |
|
1487 | 1452 | |
@@ -1578,9 +1543,7 b' class ApiController(JSONRPCController):' | |||
|
1578 | 1543 | "success": true |
|
1579 | 1544 | } |
|
1580 | 1545 | error: null |
|
1581 | ||
|
1582 | 1546 | """ |
|
1583 | ||
|
1584 | 1547 | repo = get_repo_or_error(repoid) |
|
1585 | 1548 | user = get_user_or_error(userid) |
|
1586 | 1549 | try: |
@@ -1620,7 +1583,6 b' class ApiController(JSONRPCController):' | |||
|
1620 | 1583 | result : { |
|
1621 | 1584 | "msg" : "Granted perm: `<perm>` for group: `<usersgroupname>` in repo: `<reponame>`", |
|
1622 | 1585 | "success": true |
|
1623 | ||
|
1624 | 1586 | } |
|
1625 | 1587 | error : null |
|
1626 | 1588 | |
@@ -1631,7 +1593,6 b' class ApiController(JSONRPCController):' | |||
|
1631 | 1593 | error : { |
|
1632 | 1594 | "failed to edit permission for user group: `<usergroup>` in repo `<repo>`' |
|
1633 | 1595 | } |
|
1634 | ||
|
1635 | 1596 | """ |
|
1636 | 1597 | repo = get_repo_or_error(repoid) |
|
1637 | 1598 | perm = get_perm_or_error(perm) |
@@ -1753,7 +1714,6 b' class ApiController(JSONRPCController):' | |||
|
1753 | 1714 | def get_repo_groups(self): |
|
1754 | 1715 | """ |
|
1755 | 1716 | Returns all repository groups |
|
1756 | ||
|
1757 | 1717 | """ |
|
1758 | 1718 | return [ |
|
1759 | 1719 | repo_group.get_api_data() |
@@ -1796,7 +1756,6 b' class ApiController(JSONRPCController):' | |||
|
1796 | 1756 | error : { |
|
1797 | 1757 | failed to create repo group `<repogroupid>` |
|
1798 | 1758 | } |
|
1799 | ||
|
1800 | 1759 | """ |
|
1801 | 1760 | if db.RepoGroup.get_by_group_name(group_name): |
|
1802 | 1761 | raise JSONRPCError("repo group `%s` already exist" % (group_name,)) |
@@ -1854,7 +1813,6 b' class ApiController(JSONRPCController):' | |||
|
1854 | 1813 | @HasPermissionAnyDecorator('hg.admin') |
|
1855 | 1814 | def delete_repo_group(self, repogroupid): |
|
1856 | 1815 | """ |
|
1857 | ||
|
1858 | 1816 | :param repogroupid: name or id of repository group |
|
1859 | 1817 | :type repogroupid: str or int |
|
1860 | 1818 | |
@@ -1874,7 +1832,6 b' class ApiController(JSONRPCController):' | |||
|
1874 | 1832 | error : { |
|
1875 | 1833 | "failed to delete repo group ID:<repogroupid> <repogroupname>" |
|
1876 | 1834 | } |
|
1877 | ||
|
1878 | 1835 | """ |
|
1879 | 1836 | repo_group = get_repo_group_or_error(repogroupid) |
|
1880 | 1837 | |
@@ -1925,9 +1882,7 b' class ApiController(JSONRPCController):' | |||
|
1925 | 1882 | error : { |
|
1926 | 1883 | "failed to edit permission for user: `<userid>` in repo group: `<repo_group_name>`" |
|
1927 | 1884 | } |
|
1928 | ||
|
1929 | 1885 | """ |
|
1930 | ||
|
1931 | 1886 | repo_group = get_repo_group_or_error(repogroupid) |
|
1932 | 1887 | |
|
1933 | 1888 | if not HasPermissionAny('hg.admin')(): |
@@ -1987,9 +1942,7 b' class ApiController(JSONRPCController):' | |||
|
1987 | 1942 | error : { |
|
1988 | 1943 | "failed to edit permission for user: `<userid>` in repo group: `<repo_group_name>`" |
|
1989 | 1944 | } |
|
1990 | ||
|
1991 | 1945 | """ |
|
1992 | ||
|
1993 | 1946 | repo_group = get_repo_group_or_error(repogroupid) |
|
1994 | 1947 | |
|
1995 | 1948 | if not HasPermissionAny('hg.admin')(): |
@@ -2042,7 +1995,6 b' class ApiController(JSONRPCController):' | |||
|
2042 | 1995 | result : { |
|
2043 | 1996 | "msg" : "Granted perm: `<perm>` (recursive:<apply_to_children>) for user group: `<usersgroupname>` in repo group: `<repo_group_name>`", |
|
2044 | 1997 | "success": true |
|
2045 | ||
|
2046 | 1998 | } |
|
2047 | 1999 | error : null |
|
2048 | 2000 | |
@@ -2053,7 +2005,6 b' class ApiController(JSONRPCController):' | |||
|
2053 | 2005 | error : { |
|
2054 | 2006 | "failed to edit permission for user group: `<usergroup>` in repo group: `<repo_group_name>`" |
|
2055 | 2007 | } |
|
2056 | ||
|
2057 | 2008 | """ |
|
2058 | 2009 | repo_group = get_repo_group_or_error(repogroupid) |
|
2059 | 2010 | perm = get_perm_or_error(perm, prefix='group.') |
@@ -2121,8 +2072,6 b' class ApiController(JSONRPCController):' | |||
|
2121 | 2072 | error : { |
|
2122 | 2073 | "failed to edit permission for user group: `<usergroup>` in repo group: `<repo_group_name>`" |
|
2123 | 2074 | } |
|
2124 | ||
|
2125 | ||
|
2126 | 2075 | """ |
|
2127 | 2076 | repo_group = get_repo_group_or_error(repogroupid) |
|
2128 | 2077 | user_group = get_user_group_or_error(usergroupid) |
@@ -2200,7 +2149,6 b' class ApiController(JSONRPCController):' | |||
|
2200 | 2149 | def create_gist(self, files, owner=None, |
|
2201 | 2150 | gist_type=db.Gist.GIST_PUBLIC, lifetime=-1, |
|
2202 | 2151 | description=''): |
|
2203 | ||
|
2204 | 2152 | """ |
|
2205 | 2153 | Creates new Gist |
|
2206 | 2154 | |
@@ -2233,7 +2181,6 b' class ApiController(JSONRPCController):' | |||
|
2233 | 2181 | error : { |
|
2234 | 2182 | "failed to create gist" |
|
2235 | 2183 | } |
|
2236 | ||
|
2237 | 2184 | """ |
|
2238 | 2185 | try: |
|
2239 | 2186 | if owner is None: |
@@ -2280,7 +2227,6 b' class ApiController(JSONRPCController):' | |||
|
2280 | 2227 | error : { |
|
2281 | 2228 | "failed to delete gist ID:<gist_id>" |
|
2282 | 2229 | } |
|
2283 | ||
|
2284 | 2230 | """ |
|
2285 | 2231 | gist = get_gist_or_error(gistid) |
|
2286 | 2232 | if not HasPermissionAny('hg.admin')(): |
General Comments 0
You need to be logged in to leave comments.
Login now