##// END OF EJS Templates
hgweb: move ismember from `hgweb.common` to `scmutil`...
marmoute -
r51314:4bddc2f7 default
parent child Browse files
Show More
@@ -21,6 +21,7 b' from ..pycompat import ('
21 from .. import (
21 from .. import (
22 encoding,
22 encoding,
23 pycompat,
23 pycompat,
24 scmutil,
24 templater,
25 templater,
25 util,
26 util,
26 )
27 )
@@ -39,15 +40,7 b' HTTP_NOT_ACCEPTABLE = 406'
39 HTTP_UNSUPPORTED_MEDIA_TYPE = 415
40 HTTP_UNSUPPORTED_MEDIA_TYPE = 415
40 HTTP_SERVER_ERROR = 500
41 HTTP_SERVER_ERROR = 500
41
42
42
43 ismember = scmutil.ismember
43 def ismember(ui, username, userlist):
44 """Check if username is a member of userlist.
45
46 If userlist has a single '*' member, all users are considered members.
47 Can be overridden by extensions to provide more complex authorization
48 schemes.
49 """
50 return userlist == [b'*'] or username in userlist
51
44
52
45
53 def hashiddenaccess(repo, req):
46 def hashiddenaccess(repo, req):
@@ -2313,3 +2313,13 b' def format_bookmark_revspec(mark):'
2313 mark,
2313 mark,
2314 mark,
2314 mark,
2315 )
2315 )
2316
2317
2318 def ismember(ui, username, userlist):
2319 """Check if username is a member of userlist.
2320
2321 If userlist has a single '*' member, all users are considered members.
2322 Can be overridden by extensions to provide more complex authorization
2323 schemes.
2324 """
2325 return userlist == [b'*'] or username in userlist
General Comments 0
You need to be logged in to leave comments. Login now