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
707a1fc5
Commit
707a1fc5
authored
5 years ago
by
Johannes Goderbauer
Committed by
Johannes Goderbauer
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Employee_entity: grantDelete
(cherry picked from commit
e4e1e42c
)
parent
b5a23dfd
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/Employee_entity/grantDeleteProcess.js
+13
-2
13 additions, 2 deletions
entity/Employee_entity/grantDeleteProcess.js
entity/Employee_entity/recordcontainers/jdito/onDelete.js
+1
-1
1 addition, 1 deletion
entity/Employee_entity/recordcontainers/jdito/onDelete.js
with
14 additions
and
3 deletions
entity/Employee_entity/grantDeleteProcess.js
+
13
−
2
View file @
707a1fc5
...
...
@@ -2,5 +2,16 @@ import("Employee_lib");
import
(
"
Document_lib
"
);
import
(
"
system.vars
"
);
import
(
"
system.result
"
);
// TODO: Commented because of performance problems: in Filter view this Process is called for every row. Waiting for bugfix
//result.string(!DocumentUtil.hasDocuments("EMPLOYEE", null, EmployeeUtils.sliceUserId(vars.get("$field.UID"))));
\ No newline at end of file
var
res
=
false
;
//the current user should not delete himself
if
(
EmployeeUtils
.
getCurrentUserName
()
!=
vars
.
get
(
"
$field.TITLE
"
)
&&
!
EmployeeUtils
.
hasRelations
(
vars
.
get
(
"
$field.CONTACT_ID
"
))
&&
!
DocumentUtil
.
hasDocuments
(
"
EMPLOYEE
"
,
null
,
EmployeeUtils
.
sliceUserId
(
vars
.
get
(
"
$field.UID
"
)))
)
{
res
=
true
;
}
result
.
string
(
res
);
\ No newline at end of file
This diff is collapsed.
Click to expand it.
entity/Employee_entity/recordcontainers/jdito/onDelete.js
+
1
−
1
View file @
707a1fc5
...
...
@@ -3,6 +3,6 @@ import("system.vars");
import
(
"
system.tools
"
);
import
(
"
Employee_lib
"
);
//
TODO:
the current user should not delete himself
, put this condition in grantDelete when available
//the current user should not delete himself
if
(
EmployeeUtils
.
getCurrentUserName
()
!=
vars
.
get
(
"
$field.TITLE
"
)
&&
!
EmployeeUtils
.
hasRelations
(
vars
.
get
(
"
$field.CONTACT_ID
"
)))
tools
.
deleteUser
(
vars
.
get
(
"
$field.TITLE
"
));
\ No newline at end of file
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