Documentation for the Code¶
-
class
pyrollout.feature.
Feature
(name, groups=None, percentage=None, randomize=False, users=None)[source]¶ -
__init__
(name, groups=None, percentage=None, randomize=False, users=None)[source]¶ A representation of a feature for use in PyRollout.
Parameters: - name (basestring) – Name of feature, this is what you will pass in when checking access
- groups (list) – optional list of group names to allow access to “ALL” and “NONE” are special names
- percentage (int) – 0-100 percentage of users who should have access
- randomize (bool) – randomize percentage access, normally based simply on user ID
- users (list) – list of user IDs that should have access
-
can
(user_storage, user)[source]¶ Check if user, stored in user_storage, can access this feature.
Parameters: Returns: Can user access feature
Return type:
-
can_group
(user_storage, user)[source]¶ Check if user can access feature by group.
Parameters: Returns: Can user access feature
Return type:
-