Mercurial > wikked
changeset 284:e2e809fb44d4
Make the authentication manager work with the new meta API.
| author | Ludovic Chabant <ludovic@chabant.com> |
|---|---|
| date | Sat, 27 Sep 2014 14:05:41 -0700 |
| parents | c9a6c329f24e |
| children | bdc682d02427 |
| files | wikked/auth.py |
| diffstat | 1 files changed, 10 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/wikked/auth.py Sat Sep 27 14:05:19 2014 -0700 +++ b/wikked/auth.py Sat Sep 27 14:05:41 2014 -0700 @@ -65,13 +65,16 @@ perm = page.getMeta(meta_name) if perm is not None: # Permissions are declared at the page level. - for p in perm: - allowed = [r.strip() for r in re.split(r'[ ,;]', p)] - if username is None and 'anonymous' in allowed: - return True - if username is not None and ( - '*' in allowed or username in allowed): - return True + if isinstance(perm, list): + perm = ','.join(perm) + + allowed = [r.strip() for r in re.split(r'[ ,;]', perm)] + if username is None and 'anonymous' in allowed: + return True + if username is not None and ( + '*' in allowed or username in allowed): + return True + return False perm = self._permissions.get(meta_name) @@ -84,7 +87,6 @@ return True return False - # No permissions declared anywhere. return True def _updatePermissions(self, config):
