Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
basic
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
xrm
basic
Commits
792915e3
Commit
792915e3
authored
5 years ago
by
Simon Leipold
Browse files
Options
Downloads
Patches
Plain Diff
Permissions - bug fix - sorting takes condition into account now
parent
cf5749d1
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
entity/PermissionDetail_entity/recordcontainers/jdito/contentProcess.js
+15
-13
15 additions, 13 deletions
...ionDetail_entity/recordcontainers/jdito/contentProcess.js
with
15 additions
and
13 deletions
entity/PermissionDetail_entity/recordcontainers/jdito/contentProcess.js
+
15
−
13
View file @
792915e3
...
...
@@ -106,7 +106,8 @@ if (selectedPermission == null) {
}
}
result
.
object
(
res
.
sort
(
sortResultsByCondition
).
sort
(
sortResultsByAccessTypes
));
res
=
res
.
sort
(
sortResultsByCondition
).
sort
(
sortResultsByAccessTypes
);
result
.
object
(
res
);
function
prepareResultArray
(
pEntry
,
pRes
)
{
var
parentPermission
=
""
;
...
...
@@ -163,7 +164,10 @@ function sortActions(actions, accesstype) {
// sorts result array: Entity -> Records -> Fields
function
sortResultsByAccessTypes
(
a
,
b
)
{
if
(
a
[
6
]
==
b
[
6
]
&&
a
[
6
]
!=
"
F
"
&&
a
[
6
]
!=
"
R
"
)
var
noCondA
=
"
{
\"
entity
\"
:
\"
"
+
a
[
1
]
+
"
\"
,
\"
filter
\"
:{
\"
type
\"
:
\"
group
\"
,
\"
operator
\"
:
\"
AND
\"
,
\"
childs
\"
:[]}}
"
;
var
noCondB
=
"
{
\"
entity
\"
:
\"
"
+
b
[
1
]
+
"
\"
,
\"
filter
\"
:{
\"
type
\"
:
\"
group
\"
,
\"
operator
\"
:
\"
AND
\"
,
\"
childs
\"
:[]}}
"
;
if
(
a
[
6
]
==
b
[
6
]
&&
a
[
6
]
==
"
E
"
)
return
0
;
else
if
(
a
[
6
]
==
"
E
"
)
return
-
1
;
...
...
@@ -173,28 +177,26 @@ function sortResultsByAccessTypes(a, b) {
return
-
1
;
else
if
(
a
[
6
]
==
"
F
"
&&
b
[
6
]
==
"
R
"
)
return
1
;
else
if
(
a
[
6
]
==
"
R
"
&&
b
[
6
]
==
"
R
"
&&
a
[
4
]
==
""
)
return
-
1
;
else
if
(
a
[
6
]
==
"
R
"
&&
b
[
6
]
==
"
R
"
&&
b
[
4
]
==
""
)
return
1
;
else
if
(
a
[
6
]
==
"
F
"
&&
b
[
6
]
==
"
F
"
&&
a
[
4
]
==
""
)
else
if
(
a
[
6
]
==
b
[
6
]
&&
(
a
[
4
]
==
""
||
a
[
4
]
==
noCondA
))
return
-
1
;
else
if
(
a
[
6
]
==
"
F
"
&&
b
[
6
]
==
"
F
"
&&
b
[
4
]
==
""
)
else
if
(
a
[
6
]
==
b
[
6
]
&&
(
b
[
4
]
==
""
||
b
[
4
]
==
noCondB
)
)
return
1
;
else
else
return
0
;
}
// sorts result array: default permission -> conditional permission
function
sortResultsByCondition
(
a
,
b
)
{
var
noCond
=
"
{
\"
entity
\"
:
\"
"
+
vars
.
get
(
"
$field.ENTITY
"
)
+
"
\"
,
\"
filter
\"
:{
\"
type
\"
:
\"
group
\"
,
\"
operator
\"
:
\"
AND
\"
,
\"
childs
\"
:[]}}
"
;
var
noCondA
=
"
{
\"
entity
\"
:
\"
"
+
a
[
1
]
+
"
\"
,
\"
filter
\"
:{
\"
type
\"
:
\"
group
\"
,
\"
operator
\"
:
\"
AND
\"
,
\"
childs
\"
:[]}}
"
;
var
noCondB
=
"
{
\"
entity
\"
:
\"
"
+
b
[
1
]
+
"
\"
,
\"
filter
\"
:{
\"
type
\"
:
\"
group
\"
,
\"
operator
\"
:
\"
AND
\"
,
\"
childs
\"
:[]}}
"
;
if
(
a
[
4
]
==
""
||
a
[
4
]
==
noCond
)
{
return
-
1
;
}
else
if
(
b
[
4
]
==
""
||
b
[
4
]
==
noCond
)
{
}
else
if
(
b
[
4
]
==
""
||
b
[
4
]
==
noCond
B
)
{
return
-
1
;
}
else
if
(
a
[
4
]
!=
""
&&
a
[
4
]
!=
noCond
)
{
}
else
if
(
a
[
4
]
!=
""
&&
a
[
4
]
!=
noCond
A
)
{
return
1
;
}
else
if
(
b
[
4
]
!=
""
&&
b
[
4
]
!=
noCond
)
{
}
else
if
(
b
[
4
]
!=
""
&&
b
[
4
]
!=
noCond
B
)
{
return
1
;
}
else
{
return
0
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment