Skip to content

Commit 5590884

Browse files
authored
Update an example to not use oppressive language (encode#7439)
* Update an example to use less oppressive language For reference: https://tools.ietf.org/id/draft-knodel-terminology-00.html * Code review update Blocklisted -> blocked.
1 parent c252c3d commit 5590884

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

docs/api-guide/permissions.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -243,19 +243,19 @@ Custom permissions will raise a `PermissionDenied` exception if the test fails.
243243

244244
## Examples
245245

246-
The following is an example of a permission class that checks the incoming request's IP address against a blacklist, and denies the request if the IP has been blacklisted.
246+
The following is an example of a permission class that checks the incoming request's IP address against a blocklist, and denies the request if the IP has been blocked.
247247

248248
from rest_framework import permissions
249249

250-
class BlacklistPermission(permissions.BasePermission):
250+
class BlocklistPermission(permissions.BasePermission):
251251
"""
252-
Global permission check for blacklisted IPs.
252+
Global permission check for blocked IPs.
253253
"""
254254

255255
def has_permission(self, request, view):
256256
ip_addr = request.META['REMOTE_ADDR']
257-
blacklisted = Blacklist.objects.filter(ip_addr=ip_addr).exists()
258-
return not blacklisted
257+
blocked = Blocklist.objects.filter(ip_addr=ip_addr).exists()
258+
return not blocked
259259

260260
As well as global permissions, that are run against all incoming requests, you can also create object-level permissions, that are only run against operations that affect a particular object instance. For example:
261261

0 commit comments

Comments
 (0)