Dear All,
How do you manage user privilege to access certain menu item / edit fields, etc. on your FW?
What is best suited structure? I dunno if I am asking the right question, help me out here.
Any Idea?
How do you handle User Access on your FW App
How do you handle User Access on your FW App
Kind Regards,
Frances
Fivewin for xHarbour v18.07
xHarbour v1.2.3.x
BCC 7.3 + PellesC8 ( Resource Compiler only)
ADS 10.1 / MariaDB
Crystal Reports 8.5/9.23 DE
xMate v1.15
Frances
Fivewin for xHarbour v18.07
xHarbour v1.2.3.x
BCC 7.3 + PellesC8 ( Resource Compiler only)
ADS 10.1 / MariaDB
Crystal Reports 8.5/9.23 DE
xMate v1.15
Re: How do you handle User Access on your FW App
Simple logig is enable/disable Menu Item according to user's rights
Regards, Greetings
Try FWH. You will enjoy it's simplicity and power.!
Try FWH. You will enjoy it's simplicity and power.!
Re: How do you handle User Access on your FW App
Hi,bpd2000 wrote:Simple logig is enable/disable Menu Item according to user's rights
User menu/item is fine.. but what about get objects you define each object per user?
Kind Regards,
Frances
Fivewin for xHarbour v18.07
xHarbour v1.2.3.x
BCC 7.3 + PellesC8 ( Resource Compiler only)
ADS 10.1 / MariaDB
Crystal Reports 8.5/9.23 DE
xMate v1.15
Frances
Fivewin for xHarbour v18.07
xHarbour v1.2.3.x
BCC 7.3 + PellesC8 ( Resource Compiler only)
ADS 10.1 / MariaDB
Crystal Reports 8.5/9.23 DE
xMate v1.15
- Marc Venken
- Posts: 727
- Joined: Tue Jun 14, 2016 7:51 am
Re: How do you handle User Access on your FW App
I have a xbrowse for users previliges for menu's etc..
When they login I read these into a array for granting access to things.
I use a simple loop for showing the buttons that are relevant for that user :
Or I disable the buttons itself
I also make groups of users for easy access to parts of the program.
There are surely better ways, but this is simple... Maybe there will come better sollutions.
When they login I read these into a array for granting access to things.
Code: Select all
aTPloegen := ArrTranspose( oRs:GetRows() )
for i = 1 to len(aPloegen)
aadd(aToegang,aTploegen[ 6+I ][1]) // 6 = aantal velden in de browse
next
Code: Select all
lFirsttime:= .T.
for i = 1 to len(aPloegen)
if aToegang[i]
nMove+=30
if aPloegTypes[i] .and. lFirsttime
lFirsttime:= .F.
nMove:=30
nTop:= 90
nLeft:= 1195
endif
@ nTop+nMove,nLeft BTNBMP aBtn[i] OF oDlg SIZE 80, 25 NOBORDER PROMPT aPloegen[i] 2007 ACTION (oRs:SetFilter( "ploeg2018 = ? and exlid = ?", { ::cCaption, .F. } ), oBrw[oFld:nOption]:GoTop(), oBrw[oFld:nOption]:Refresh(),oBrw[oFld:nOption]:setfocus(),oPloeg:refresh(),oBrw[oFld:nOption]:maketotals() ) font oBold CENTER
endif
next
I also make groups of users for easy access to parts of the program.
There are surely better ways, but this is simple... Maybe there will come better sollutions.
Marc Venken
Using: FWH 20.08 with Harbour
Using: FWH 20.08 with Harbour
- Rick Lipkin
- Posts: 2397
- Joined: Fri Oct 07, 2005 1:50 pm
- Location: Columbia, South Carolina USA
Re: How do you handle User Access on your FW App
Validating a user is not difficult .. first of all I use the function WnetGetUser:
Take the results of xLogin and search your user table .. if you find a match .. like Marc mentions .. grant roles to that user based on your logic .. the only time I force a login is if the search for xLogin is not found ...
WNetGetUser() returns the value of the user ( Rick Lipkin ) currently logged into their computer .. Assign the roles to variables :
xRead = "Y"
xWrite = "Y"
xMgr = "Y' ... etc
Then interrogate your variables in your menus or modules and enable or disable as appropriate.
Rick Lipkin
Code: Select all
xLOGIN := UPPER( WNetGetuser() )+space(15) // fivewin function
xLOGIN := SUBSTR(xLOGIN,1,15)
WNetGetUser() returns the value of the user ( Rick Lipkin ) currently logged into their computer .. Assign the roles to variables :
xRead = "Y"
xWrite = "Y"
xMgr = "Y' ... etc
Then interrogate your variables in your menus or modules and enable or disable as appropriate.
Rick Lipkin
Re: How do you handle User Access on your FW App
Dear Gentlemen Mr. Marc and Mr. Rick,
Thanks for the great Idea
I got it sorted now.. defining :nID for each object I wish to control (enable/disable) defined in user table..
iterate these objects based also on defined :nID of Dialog/Window..
Before I used to define menu to access dialogs.. now I control object access per user.. great for multi-user-multi-task level control.
Thanks for the great Idea
I got it sorted now.. defining :nID for each object I wish to control (enable/disable) defined in user table..
iterate these objects based also on defined :nID of Dialog/Window..
Before I used to define menu to access dialogs.. now I control object access per user.. great for multi-user-multi-task level control.
Kind Regards,
Frances
Fivewin for xHarbour v18.07
xHarbour v1.2.3.x
BCC 7.3 + PellesC8 ( Resource Compiler only)
ADS 10.1 / MariaDB
Crystal Reports 8.5/9.23 DE
xMate v1.15
Frances
Fivewin for xHarbour v18.07
xHarbour v1.2.3.x
BCC 7.3 + PellesC8 ( Resource Compiler only)
ADS 10.1 / MariaDB
Crystal Reports 8.5/9.23 DE
xMate v1.15