diff options
author | Stefan Giehl <stefan@matomo.org> | 2020-04-23 10:43:30 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-23 10:43:30 +0300 |
commit | a8d917778e75346eab9509ac9707f7e6e2e6c58d (patch) | |
tree | 8259898ab33eb882e631f1f5475cd1482f70e402 /core/Plugin/Segment.php | |
parent | 0cdeb6da6e4679c56aa351c004cbd6afe7843c56 (diff) |
Refactores the way segments are configured in dimensions (#15836)
* Improve naming of methods for segments to rescrict access for anonymous user
* Introduce new classes SegmentsList nad DimensionSegmentFactory
* removes SegmentEditor\SegmentList and adds some tests
* submodule updates
Diffstat (limited to 'core/Plugin/Segment.php')
-rw-r--r-- | core/Plugin/Segment.php | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/core/Plugin/Segment.php b/core/Plugin/Segment.php index 5e09c409c1..122833835a 100644 --- a/core/Plugin/Segment.php +++ b/core/Plugin/Segment.php @@ -58,12 +58,11 @@ class Segment private $suggestedValuesApi = ''; /** - * If true, this segment will only be visible to the user if the user has view access - * to one of the requested sites (see API.getSegmentsMetadata). + * If true, this segment will only be visible to a registered user (see API.getSegmentsMetadata). * * @var bool */ - private $requiresAtLeastViewAccess = false; + private $requiresRegisteredUser = false; /** * @ignore @@ -382,28 +381,27 @@ class Segment } /** - * Returns true if this segment should only be visible to the user if the user has view access - * to one of the requested sites (see API.getSegmentsMetadata), false if it should always be - * visible to the user (even the anonymous user). + * Returns true if this segment should only be visible to registered users (see API.getSegmentsMetadata), + * false if it should always be visible to any user (even the anonymous user). * * @return boolean * @ignore */ - public function isRequiresAtLeastViewAccess() + public function isRequiresRegisteredUser() { - return $this->requiresAtLeastViewAccess; + return $this->requiresRegisteredUser; } /** - * Sets whether the segment should only be visible if the user requesting it has view access - * to one of the requested sites and if the user is not the anonymous user. + * Sets whether the segment should only be visible to registered users. If set to false it will be even visible to + * the anonymous user * - * @param boolean $requiresAtLeastViewAccess + * @param boolean $requiresRegisteredUser * @ignore */ - public function setRequiresAtLeastViewAccess($requiresAtLeastViewAccess) + public function setRequiresRegisteredUser($requiresRegisteredUser) { - $this->requiresAtLeastViewAccess = $requiresAtLeastViewAccess; + $this->requiresRegisteredUser = $requiresRegisteredUser; } /** |