53 if ($this->session_manager->isLoggedIn()) {
57 $this->redirects->setLastForwardFrom();
69 if (!$this->session_manager->isLoggedIn()) {
87 $this->assertAuthenticatedUser();
89 $user = $this->session_manager->getLoggedInUser();
90 if (
$user->isAdmin()) {
94 $this->redirects->setLastForwardFrom();
123 'route' => $this->request->get(
'_route'),
149 $msg = $this->translator->translate(
'limited_access');
154 'route' => $this->request->get(
'_route'),
161 $msg = $this->translator->translate(
'limited_access');
166 'route' => $this->request->get(
'_route'),
171 if (!$entity->
isEnabled() && !$this->session_manager->getDisabledEntityVisibility()) {
177 'route' => $this->request->get(
'_route'),
183 $this->assertAccessibleGroup($entity,
$user);
186 foreach ([
'owner_guid',
'container_guid'] as $prop) {
187 if (!$entity->$prop) {
191 $parent = $this->assertExists($entity->$prop);
192 $this->assertAccessibleEntity($parent,
$user);
201 'route' => $this->request->get(
'_route'),
208 }
else if (
$result ===
false) {
209 throw new HttpException();
227 if (!isset($viewer)) {
228 $viewer = $this->session_manager->getLoggedInUser();
231 if (!$viewer || !$viewer->isAdmin()) {
236 'route' => $this->request->get(
'_route'),
257 $this->assertAuthenticatedUser();
259 $this->redirects->setLastForwardFrom();
265 'route' => $this->request->get(
'_route'),
278 if ($this->request->isXmlHttpRequest()) {
elgg_call(int $flags, Closure $closure)
Calls a callable autowiring the arguments using public DI services and applying logic based on flags...
if(!elgg_get_config('trash_enabled')) $group
$params
Saves global plugin settings.
assertXmlHttpRequest()
Require XmlHttpRequest.
c Accompany it with the information you received as to the offer to distribute corresponding source complete source code means all the source code for all modules it plus any associated interface definition plus the scripts used to control compilation and installation of the executable as a special the source code distributed need not include anything that is normally and so on of the operating system on which the executable unless that component itself accompanies the executable If distribution of executable or object code is made by offering access to copy from a designated then offering equivalent access to copy the source code from the same place counts as distribution of the source even though third parties are not compelled to copy the source along with the object code You may not or distribute the Program except as expressly provided under this License Any attempt otherwise to sublicense or distribute the Program is void
Thrown when the logged in user is not an admin.
assertAccessibleGroup(\ElggGroup $group,\ElggUser $user=null)
Validate group content visibility.
Thrown when the not logged in.
__construct(protected SessionManagerService $session_manager, protected HttpRequest $request, protected RedirectService $redirects, protected EntityTable $entities, protected AccessCollections $access, protected Translator $translator)
Constructor.
canEdit(int $user_guid=0)
Can a user edit this entity?
assertUnauthenticatedUser()
Require a user to be not authenticated (logged out) to with code execution.
Handles common tasks when redirecting a request.
const ELGG_IGNORE_ACCESS
elgg_call() flags
assertAccessibleEntity(\ElggEntity $entity,\ElggUser $user=null, bool $validate_can_edit=false)
Require that authenticated user has access to entity.
assertExists(int $guid, string $type=null, string $subtype=null)
Require an entity with a given guid, type and subtype to proceed with code execution.
Thrown when one of the gatekeepers prevents access.
const ELGG_SHOW_DISABLED_ENTITIES
assertAuthenticatedAdmin()
Require an admin user to be authenticated to proceed with code execution.
Thrown when entity can not be edited or container permissions do not allow it to be written...
hasAccess(int $user_guid=0)
Check if the given user has access to this entity.
assertAccessibleUser(\ElggUser $user,\ElggUser $viewer=null)
Validate active user account.
elgg_get_site_url()
Get the URL for the current (or specified) site, ending with "/".
isEnabled()
Is this entity enabled?
assertAuthenticatedUser()
Require a user to be authenticated to with code execution.
Aggregate action for saving settings.
_elgg_services()
Get the global service provider.
isBanned()
Is this user banned or not?
canAccessContent(ElggUser $user=null)
Check if current user can access group content based on his/her membership status and group's content...
Thrown when entity can not be found.
Thrown when the request is not a valid ajax request.
Thrown when logged in but this isn't allowed.
getURL()
Gets the URL for this entity.
Entity table database service.
$guid
Reset an ElggUpgrade.