Skip to content
This repository has been archived by the owner on Apr 9, 2023. It is now read-only.

Commit

Permalink
Merge pull request #44 from plone/auth-role
Browse files Browse the repository at this point in the history
Automatically give authenticated users new `plone.Authenticated` role
  • Loading branch information
bloodbare committed Dec 27, 2016
2 parents bb6302f + 6dcd419 commit a4d343f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/plone.server/CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
1.0a9 (unreleased)
------------------

- Automatically give authenticated users new `plone.Authenticated` role
[vangheem]

- Handle error when deserializing content when not authenticated and checking
permissions
[vangheem]
Expand Down
2 changes: 2 additions & 0 deletions src/plone.server/plone/server/auth/participation.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ async def __call__(self):
if user is not None:
self.request._cache_user = user
self.principal = user
if hasattr(user, '_roles') and 'plone.Authenticated' not in user._roles:
user._roles['plone.Authenticated'] = 1
else:
self.principal = getattr(self.request, '_cache_user', None)

Expand Down
6 changes: 6 additions & 0 deletions src/plone.server/plone/server/permissions.zcml
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,12 @@
description="All users have this role implicitly"
/>

<role
id="plone.Authenticated"
title="Authenticated user"
description="Role automatically assigned to authenticated users"
/>

<role
id="plone.Member"
title="Site Member" />
Expand Down

0 comments on commit a4d343f

Please sign in to comment.