Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2561)

Unified Diff: appengine/swarming/server/task_request.py

Issue 2984843002: swarming: switch to a 'capability focused' ACL system (Closed)
Patch Set: Address comments Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: appengine/swarming/server/task_request.py
diff --git a/appengine/swarming/server/task_request.py b/appengine/swarming/server/task_request.py
index db3258acaf4b2229db6493644400c27407a9376b..b86d1c575adbf4e48699169c98a0c5ffabe03b60 100644
--- a/appengine/swarming/server/task_request.py
+++ b/appengine/swarming/server/task_request.py
@@ -715,20 +715,6 @@ class TaskRequest(ndb.Model):
"""Reconstructs this value from expiration_ts and created_ts. Integer."""
return int((self.expiration_ts - self.created_ts).total_seconds())
- @property
- def has_access(self):
- """Returns True if the current user has read-write access to this request.
-
- This is used for:
- * Read access: ability to read the task info and logs.
- * Write access: ability to cancel the task.
-
- Warning: This function looks at the current Authentication context.
- """
- return (
- acl.is_privileged_user() or
- self.authenticated == auth.get_current_identity())
-
def to_dict(self):
"""Converts properties_hash to hex so it is json serializable."""
# to_dict() doesn't recurse correctly into ndb.LocalStructuredProperty!
« appengine/swarming/proto/config.proto ('K') | « appengine/swarming/server/acl_test.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698