534d9c20e2cec6b524f0348aadffdd9a472a8413,gridchat/validator.py,,validate_acl,#Any#,200
Before Change
def validate_acl(activity: Activity) -> (bool, str):
session = env.session()
redis = env.redis()
logger = env.logger()
room_id = activity.target.id
room_name = utils.get_room_name(redis, room_id)
user_id = session.get("user_id", "NOT_FOUND_IN_SESSION")
After Change
if env.redis.sismember(rkeys.room_owners(room_id), user_id):
env.logger.debug("user %s (%s) is an owner of room %s (%s), skipping ACL validation" %
(user_id, user_name, room_id, room_name))
return True, None
encoded_acls = env.redis.hgetall(rkeys.room_acl(room_id))
if len(encoded_acls) == 0:
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 3
Instances
Project Name: thenetcircle/dino
Commit Name: 534d9c20e2cec6b524f0348aadffdd9a472a8413
Time: 2016-09-23
Author: oscar@thenetcircle.com
File Name: gridchat/validator.py
Class Name:
Method Name: validate_acl
Project Name: facebookresearch/Horizon
Commit Name: f75a44cac3ae7bfc8810bad5127854a131d48a9c
Time: 2020-06-30
Author: alexschneidman@fb.com
File Name: reagent/ope/estimators/contextual_bandits_estimators.py
Class Name: DMEstimator
Method Name: evaluate
Project Name: facebookresearch/Horizon
Commit Name: f75a44cac3ae7bfc8810bad5127854a131d48a9c
Time: 2020-06-30
Author: alexschneidman@fb.com
File Name: reagent/ope/estimators/contextual_bandits_estimators.py
Class Name: DoublyRobustEstimator
Method Name: evaluate