Skip to content
Next
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
Minds Backend - Engine
Project
Project
Details
Activity
Releases
Cycle Analytics
Insights
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Locked Files
Issues
213
Issues
213
List
Boards
Labels
Service Desk
Milestones
Merge Requests
34
Merge Requests
34
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Security & Compliance
Security & Compliance
Dependency List
Packages
Packages
List
Container Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Minds
Minds Backend - Engine
Commits
e399b351
Commit
e399b351
authored
21 minutes ago
by
Mark Harding
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(chore): improve efficiency of filter check
parent
c610fdda
epic/post-scheduler
1 merge request
!294
epic/post-scheduler
Pipeline
#82603091
passed with stages
in 12 minutes and 16 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
FilterEntitiesDelegate.php
Core/Entities/Delegates/FilterEntitiesDelegate.php
+4
-3
No files found.
Core/Entities/Delegates/FilterEntitiesDelegate.php
View file @
e399b351
...
...
@@ -18,6 +18,7 @@ class FilterEntitiesDelegate
/** @var User */
protected
$user
;
/** @var int */
protected
$time
;
public
function
__construct
(
$user
,
$time
,
$acl
=
null
)
...
...
@@ -37,10 +38,10 @@ class FilterEntitiesDelegate
return
array_values
(
array_filter
(
$entities
,
function
(
$entity
)
{
$filterByScheduled
=
false
;
if
(
$this
->
shouldFilterScheduled
(
$entity
->
getType
()))
{
$filterByScheduled
=
!
ACL
::
_
()
->
write
(
$entity
,
$this
->
user
)
&&
!
(
$entity
->
getTimeCreated
()
<=
$this
->
time
);
$filterByScheduled
=
$entity
->
getTimeCreated
()
>
$this
->
time
&&
!
ACL
::
_
()
->
write
(
$entity
,
$this
->
user
);
}
return
$this
->
acl
->
read
(
$entity
,
$this
->
user
)
&&
!
$filterByScheduled
;
return
!
$filterByScheduled
&&
$this
->
acl
->
read
(
$entity
,
$this
->
user
)
;
}));
}
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment