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
232
Issues
232
List
Boards
Labels
Service Desk
Milestones
Merge Requests
36
Merge Requests
36
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
2b856941
Commit
2b856941
authored
57 minutes ago
by
Brian Hatchet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Need the manager there, Brian
parent
3f2d80e8
chore-refactor-permissions-export
1 merge request
!349
Chore refactor permissions export
Pipeline
#86151529
passed with stages
in 9 minutes and 52 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
Api/Factory.php
Api/Factory.php
+4
-2
No files found.
Api/Factory.php
View file @
2b856941
...
...
@@ -209,7 +209,7 @@ class Factory
* @return array - an array of the entities
* @deprecated
*/
public
static
function
exportable
(
$entities
,
$exceptions
=
[],
$exportContext
=
false
,
$includePermissions
=
true
)
:
array
public
static
function
exportable
(
$entities
=
[],
$exceptions
=
[],
$exportContext
=
false
,
$includePermissions
=
true
)
{
foreach
(
$entities
as
$k
=>
$entity
)
{
$entities
[
$k
]
=
Factory
::
export
(
$entity
,
$exceptions
,
$exportContext
,
$includePermissions
);
...
...
@@ -220,7 +220,7 @@ class Factory
/**
* Exports a single entity, called by exportable for arrays
*/
public
static
function
export
(
$entity
,
$exceptions
=
false
,
$exportContext
=
false
,
$includePermissions
=
true
)
:
array
public
static
function
export
(
$entity
,
$exceptions
=
false
,
$exportContext
=
false
,
$includePermissions
=
true
)
{
if
(
$exportContext
&&
method_exists
(
$entity
,
'setExportContext'
))
{
$entity
->
setExportContext
(
$exportContext
);
...
...
@@ -229,6 +229,8 @@ class Factory
$export
=
$entity
->
export
();
//Calculate new permissions object with the entities
if
(
$includePermissions
&&
$entity
&&
Di
::
_
()
->
get
(
'Features\Manager'
)
->
has
(
'permissions'
))
{
/** @var Manager $permissionsManager */
$permissionsManager
=
Di
::
_
()
->
get
(
'Permissions\Manager'
);
$permissions
=
$permissionsManager
->
getList
([
'user_guid'
=>
Session
::
getLoggedinUser
(),
'entities'
=>
[
$entity
],
...
...
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