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
df9b4c40
Commit
df9b4c40
authored
5 years ago
by
Simon Leipold
Browse files
Options
Downloads
Patches
Plain Diff
Permissions - bug fix permission detail - conditional permissions did not show up
parent
87941cb8
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
entity/PermissionDetail_entity/recordcontainers/jdito/contentProcess.js
+15
-9
15 additions, 9 deletions
...ionDetail_entity/recordcontainers/jdito/contentProcess.js
process/Permission_lib/process.js
+13
-0
13 additions, 0 deletions
process/Permission_lib/process.js
with
28 additions
and
9 deletions
entity/PermissionDetail_entity/recordcontainers/jdito/contentProcess.js
+
15
−
9
View file @
df9b4c40
import
(
"
system.logging
"
);
import
(
"
Sql_lib
"
);
import
(
"
system.util
"
);
import
(
"
system.vars
"
);
...
...
@@ -106,21 +107,22 @@ if (selectedPermission == null) {
}
}
logging
.
log
(
res
.
sort
(
sortResultsByCondition
).
sort
(
sortResultsByAccessTypes
).
toSource
());
result
.
object
(
res
.
sort
(
sortResultsByCondition
).
sort
(
sortResultsByAccessTypes
));
function
prepareResultArray
(
pEntry
,
pRes
)
{
var
rootPermission
=
""
;
var
parentPermission
=
""
;
var
noCond
=
"
{
\"
entity
\"
:
\"
"
+
pEntry
.
entity
+
"
\"
,
\"
filter
\"
:{
\"
type
\"
:
\"
group
\"
,
\"
operator
\"
:
\"
AND
\"
,
\"
childs
\"
:[]}}
"
;
if
(
pEntry
.
accesstype
!=
"
E
"
)
{
if
(
pEntry
.
accesstype
==
"
F
"
&&
pEntry
.
cond
!=
""
&&
pEntry
.
cond
!=
noCond
)
{
rootPermission
=
PermissionUtil
.
getPermissionWithoutCond
(
PermissionUtil
.
getParentSet
(
pEntry
.
permissionid
));
if
(
rootPermission
==
""
)
{
rootPermission
=
PermissionUtil
.
getPermissionRoot
(
pEntry
.
permissionid
);
}
}
else
rootPermission
=
PermissionUtil
.
getPermissionRoot
(
pEntry
.
permissionid
);
if
(
pEntry
.
cond
==
""
||
pEntry
.
cond
==
noCond
)
{
// default permission
parentPermission
=
PermissionUtil
.
getPermissionWithoutCond
(
PermissionUtil
.
getParentSetOfSet
(
PermissionUtil
.
getParentSet
(
pEntry
.
permissionid
)));
}
else
{
// conditional permission
parentPermission
=
PermissionUtil
.
getPermissionWithoutCond
(
PermissionUtil
.
getParentSet
(
pEntry
.
permissionid
));
}
}
pRes
.
push
([
pEntry
.
permissionid
,
pEntry
.
entity
,
pEntry
.
role
,
pEntry
.
field
,
pEntry
.
cond
,
sortActions
(
pEntry
.
action
.
split
(
"
,
"
),
pEntry
.
accesstype
).
join
(
"
,
"
),
pEntry
.
accesstype
,
pEntry
.
condtype
,
roo
tPermission
]);
sortActions
(
pEntry
.
action
.
split
(
"
,
"
),
pEntry
.
accesstype
).
join
(
"
,
"
),
pEntry
.
accesstype
,
pEntry
.
condtype
,
paren
tPermission
]);
return
pRes
;
}
...
...
@@ -191,6 +193,10 @@ function sortResultsByCondition(a, b) {
if
(
a
[
4
]
==
""
||
a
[
4
]
==
noCond
)
{
return
-
1
;
}
else
if
(
b
[
4
]
==
""
||
b
[
4
]
==
noCond
)
{
return
-
1
;
}
else
if
(
a
[
4
]
!=
""
&&
a
[
4
]
!=
noCond
)
{
return
1
;
}
else
if
(
b
[
4
]
!=
""
&&
b
[
4
]
!=
noCond
)
{
return
1
;
}
else
{
return
0
;
...
...
This diff is collapsed.
Click to expand it.
process/Permission_lib/process.js
+
13
−
0
View file @
df9b4c40
...
...
@@ -286,6 +286,19 @@ function PermissionUtil () {}
+
"
where ASYS_PERMISSIONID = '
"
+
pPermId
+
"
'
"
;
return
db
.
cell
(
sqlStr
,
alias
);
}
/**
* Gets the parent permission set of a set.
*
* @param {String} pSetId id of the permission set
*
* @result {String} returns id of the parent permission set of the given set. Never 'null', empty string if there is no result.
*/
PermissionUtil
.
getParentSetOfSet
=
function
(
pSetId
)
{
var
sqlStr
=
"
select ASYS_PERMISSIONSET_ID from ASYS_PERMISSIONSET
"
+
"
where ASYS_PERMISSIONSETID = '
"
+
pSetId
+
"
'
"
;
return
db
.
cell
(
sqlStr
,
alias
);
}
/**
* Checks if the given permission set has any children left.
...
...
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