Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
kgOrders
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Cam Hayes
kgOrders
Commits
64f087b4
Commit
64f087b4
authored
Nov 20, 2025
by
Cam Hayes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
User page now properly recognizes admins and now sales users have limited order access
parent
bb24c447
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
15 additions
and
4 deletions
+15
-4
View.Main.pas
kgOrdersClient/View.Main.pas
+2
-1
View.Orders.pas
kgOrdersClient/View.Orders.pas
+3
-1
Auth.ServiceImpl.pas
kgOrdersServer/Source/Auth.ServiceImpl.pas
+0
-1
Lookup.ServiceImpl.pas
kgOrdersServer/Source/Lookup.ServiceImpl.pas
+9
-0
kgOrdersServer.ini
kgOrdersServer/bin/kgOrdersServer.ini
+1
-1
No files found.
kgOrdersClient/View.Main.pas
View file @
64f087b4
...
...
@@ -94,7 +94,8 @@ begin
lblUsername
.
Caption
:=
' '
+
userName
.
ToLower
+
' '
;
FChildForm
:=
nil
;
change
:=
false
;
if
(
not
(
JS
.
toBoolean
(
AuthService
.
TokenPayload
.
Properties
[
'user_admin'
])))
then
console
.
log
(
JS
.
toBoolean
(
AuthService
.
TokenPayload
.
Properties
[
'user_access_type'
]));
if
(
not
(
JS
.
toString
(
AuthService
.
TokenPayload
.
Properties
[
'user_access_type'
])
=
'ADMIN'
))
then
lblUsers
.
enabled
:=
false
;
ShowForm
(
TFViewOrders
);
...
...
kgOrdersClient/View.Orders.pas
View file @
64f087b4
...
...
@@ -848,7 +848,9 @@ begin
searchOptions
:=
'&pagenumber='
+
IntToStr
(
PageNumber
)
+
'&pagesize='
+
IntToStr
(
PageSize
)
+
'&orderby='
+
OrderBy
+
'&direction='
+
direction
;
'&direction='
+
direction
+
'&accessRights='
+
JS
.
toString
(
AuthService
.
TokenPayload
.
Properties
[
'user_access_type'
])
+
'&userID='
+
JS
.
toString
(
AuthService
.
TokenPayload
.
Properties
[
'user_id'
]);
//Status 1
if
(
(
filterType1
<>
''
)
and
(
filterType1
<>
'NONE'
)
)
then
...
...
kgOrdersServer/Source/Auth.ServiceImpl.pas
View file @
64f087b4
...
...
@@ -144,7 +144,6 @@ begin
JWT
.
Claims
.
SetClaimOfType
<
string
>(
'user_email'
,
userEmail
);
JWT
.
Claims
.
SetClaimOfType
<
string
>(
'user_qb_id'
,
userQBID
);
JWT
.
Claims
.
SetClaimOfType
<
string
>(
'user_access_type'
,
userAccessType
);
JWT
.
Claims
.
SetClaimOfType
<
string
>(
'user_admin'
,
LowerCase
(
BoolToStr
(
SameText
(
userAccessType
,
'ADMIN'
),
True
)));
Result
:=
TJOSE
.
SHA256CompactToken
(
serverConfig
.
jwtTokenSecret
,
JWT
);
finally
...
...
kgOrdersServer/Source/Lookup.ServiceImpl.pas
View file @
64f087b4
...
...
@@ -1030,6 +1030,7 @@ var
OrderID
,
CompanyID
,
JobName
,
orderType
:
string
;
status1
,
status2
:
TStatusSearchInfo
;
ForPDF
:
Boolean
;
accessRights
,
userID
:
string
;
begin
result
:=
TSQLQuery
.
Create
;
params
:=
TStringList
.
Create
;
...
...
@@ -1052,6 +1053,8 @@ begin
OrderID
:=
params
.
Values
[
'orderID'
];
companyID
:=
params
.
Values
[
'companyID'
];
jobName
:=
params
.
Values
[
'jobName'
];
accessRights
:=
params
.
Values
[
'accessRights'
];
userID
:=
params
.
Values
[
'userID'
];
status1
:=
createStatusSearchInfo
(
params
,
'1'
);
status2
:=
createStatusSearchInfo
(
params
,
'2'
);
...
...
@@ -1087,6 +1090,12 @@ begin
if
jobName
<>
''
then
whereSQL
:=
whereSQL
+
' AND o.JOB_NAME LIKE '
+
QuotedStr
(
'%'
+
jobName
+
'%'
);
if
accessRights
=
'SALES'
then
begin
whereSQL
:=
whereSQL
+
' AND c.REP_USER_ID = '
+
userID
;
end
;
orderBySQL
:=
' ORDER BY '
+
OrderBy
;
SQL
:=
SQL
+
' o.PRICE, qb.QB_REF_NUM, '
+
...
...
kgOrdersServer/bin/kgOrdersServer.ini
View file @
64f087b4
...
...
@@ -2,7 +2,7 @@
MemoLogLevel
=
4
FileLogLevel
=
4
webClientVersion
=
1.0.0
LogFileNum
=
12
6
LogFileNum
=
12
9
[Database]
--Server
=
192.168.116.138
...
...
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