Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Model Visibility Scoping Extender and Tests #2460

Merged
merged 18 commits into from
Dec 8, 2020
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 3 additions & 11 deletions src/User/UserServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,18 +94,10 @@ public function boot()
$events->subscribe(UserMetadataUpdater::class);
$events->subscribe(UserPolicy::class);

$events->listen(ConfigureUserPreferences::class, [$this, 'configureUserPreferences']);
User::registerPreference('discloseOnline', 'boolval', true);
User::registerPreference('indexProfile', 'boolval', true);
User::registerPreference('locale');

User::registerVisibilityScoper(new ScopeUserVisibility(), 'view');
}

/**
* @param ConfigureUserPreferences $event
*/
public function configureUserPreferences(ConfigureUserPreferences $event)
{
$event->add('discloseOnline', 'boolval', true);
$event->add('indexProfile', 'boolval', true);
$event->add('locale');
}
}