diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/pyramid/config/testing.py | 4 | ||||
| -rw-r--r-- | src/pyramid/interfaces.py | 10 | ||||
| -rw-r--r-- | src/pyramid/security.py | 4 | ||||
| -rw-r--r-- | src/pyramid/testing.py | 2 |
4 files changed, 10 insertions, 10 deletions
diff --git a/src/pyramid/config/testing.py b/src/pyramid/config/testing.py index 58b239232..f8d81f3d3 100644 --- a/src/pyramid/config/testing.py +++ b/src/pyramid/config/testing.py @@ -35,8 +35,8 @@ class TestingConfiguratorMixin(object): :attr:`pyramid.request.Request.authenticated_userid` will have this value as well. :type userid: str - :param identity: If provided, the policy's ``identify`` method will - return this value. As a result, + :param identity: If provided, the policy's ``authenticated_identity`` + method will return this value. As a result, :attr:`pyramid.request.Request.authenticated_identity`` will have this value. :type identity: object diff --git a/src/pyramid/interfaces.py b/src/pyramid/interfaces.py index c4160cc2b..1f089216f 100644 --- a/src/pyramid/interfaces.py +++ b/src/pyramid/interfaces.py @@ -483,16 +483,16 @@ class IViewMapperFactory(Interface): class ISecurityPolicy(Interface): + def authenticated_identity(request): + """ Return the :term:`identity` of the current user. The object can be + of any shape, such as a simple ID string or an ORM object. + """ + def authenticated_userid(request): """ Return a :term:`userid` string identifying the trusted and verified user, or ``None`` if unauthenticated. """ - def identify(request): - """ Return the :term:`identity` of the current user. The object can be - of any shape, such as a simple ID string or an ORM object. - """ - def permits(request, context, permission): """ Return an instance of :class:`pyramid.security.Allowed` if a user of the given identity is allowed the ``permission`` in the current diff --git a/src/pyramid/security.py b/src/pyramid/security.py index 8a7985a52..dc4713368 100644 --- a/src/pyramid/security.py +++ b/src/pyramid/security.py @@ -301,7 +301,7 @@ class SecurityAPIMixin: policy = _get_security_policy(self) if policy is None: return None - return policy.identify(self) + return policy.authenticated_identity(self) @property def authenticated_userid(self): @@ -432,7 +432,7 @@ class LegacySecurityPolicy: def _get_authz_policy(self, request): return request.registry.getUtility(IAuthorizationPolicy) - def identify(self, request): + def authenticated_identity(self, request): return self.authenticated_userid(request) def authenticated_userid(self, request): diff --git a/src/pyramid/testing.py b/src/pyramid/testing.py index a92bb5d03..251e1fcc2 100644 --- a/src/pyramid/testing.py +++ b/src/pyramid/testing.py @@ -58,7 +58,7 @@ class DummySecurityPolicy(object): self.remember_result = remember_result self.forget_result = forget_result - def identify(self, request): + def authenticated_identity(self, request): return self.identity def authenticated_userid(self, request): |
