Hello,
For certain reasons I had to make my own USERS table where I store username, passwd, access_lvl and so on. Now I would like to display certian data from database depending on what access_lvl logged user have. I can't think of any method how to check who is logged in:/ I thought about adding new field IS_LOGGED and update it anytime some1 loggs. But then again how will I set it false when someone will just close access?
I'd be glad for some ideas
P.S. Maybe there is some way to set access_lvl without my own USERS table I just don't know about
6 3451 dima69 181
Recognized Expert New Member
Hello,
For certain reasons I had to make my own USERS table where I store username, passwd, access_lvl and so on. Now I would like to display certian data from database depending on what access_lvl logged user have. I can't think of any method how to check who is logged in:/ I thought about adding new field IS_LOGGED and update it anytime some1 loggs. But then again how will I set it false when someone will just close access?
I'd be glad for some ideas
P.S. Maybe there is some way to set access_lvl without my own USERS table I just don't know about
You can implement this using record locking, i.e. making each user lock his record in the table on login. Then closing Access will release the lock. You will be able to diplay "Who is logged" by checking wich record is locked.
P.S. That's just the general idea, real implementation can be quite complicated :)
You can implement this using record locking, i.e. making each user lock his record in the table on login. Then closing Access will release the lock. You will be able to diplay "Who is logged" by checking wich record is locked.
P.S. That's just the general idea, real implementation can be quite complicated :)
That would be fine if there weren't any shared records. Some records can be viewed by more then one access_lvl. Also it will lock record for another user with same access_lvl
dima69 181
Recognized Expert New Member
That would be fine if there weren't any shared records. Some records can be viewed by more then one access_lvl. Also it will lock record for another user with same access_lvl
In that case you can add records to the table as user logs in (and lock it), then deleting all unlocked records.
As I said before, it's just a general direction, implementation is up to you.
I figured out that I will use Access build in security system, and to check who is logged I will use CurrentUser method. I will enable/disable forms/buttons ect depending on value of CurrentUser. It will be troublesome becouse I will have like 150 users, who can view a values in table depending on thier login. F.E. if manager1 is logged in I want to view only employees that are subordinates of manager1, same for manager2 etc. Is there some better way to do that than writing 150 IF's ? :)
Lysander 344
Recognized Expert Contributor
I figured out that I will use Access build in security system, and to check who is logged I will use CurrentUser method. I will enable/disable forms/buttons ect depending on value of CurrentUser. It will be troublesome becouse I will have like 150 users, who can view a values in table depending on thier login. F.E. if manager1 is logged in I want to view only employees that are subordinates of manager1, same for manager2 etc. Is there some better way to do that than writing 150 IF's ? :)
Create security groups and put your users into those groups (assuming there are not 150 different groups, this will be simpler). Then give those groups access to those tables you want them to see.
If you want them to see only certain rows of a table, its more tricky.
Create a superuser, i use the user 'owner' and make sure owner has full access to the table. Then, using owner, create a query, or set of queries, the select only the data you want each group to see. In the SQL for these queries, add at the end WITH OWNERACCESS OPTION
e.g. - SELECT LastName, FirstName, Salary FROM Employees ORDER BY LastName WITH OWNERACCESS OPTION;
-
Now go into the security system and remove all access to the table from all groups, except 'owner' of course. Now give full access to the query you have just created the group that needs it.
What you now have is a situation where, say, managerLevel1 log on, and cannot access the staff table, or the data in it, but can run qryManLevel1 which runs under 'owner's permissions and lets them see the selected data.
Create security groups and put your users into those groups (assuming there are not 150 different groups, this will be simpler). Then give those groups access to those tables you want them to see.
If you want them to see only certain rows of a table, its more tricky.
Create a superuser, i use the user 'owner' and make sure owner has full access to the table. Then, using owner, create a query, or set of queries, the select only the data you want each group to see. In the SQL for these queries, add at the end WITH OWNERACCESS OPTION
e.g. - SELECT LastName, FirstName, Salary FROM Employees ORDER BY LastName WITH OWNERACCESS OPTION;
-
Now go into the security system and remove all access to the table from all groups, except 'owner' of course. Now give full access to the query you have just created the group that needs it.
What you now have is a situation where, say, managerLevel1 log on, and cannot access the staff table, or the data in it, but can run qryManLevel1 which runs under 'owner's permissions and lets them see the selected data.
That is really GREAT piece of advice, thank you for that :)
Unfortunalty I DO want managers to see only certain rows of a table :/ to be more specific I want manager of department to see only empolyees working in this department. And there are like 150 departments :/
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: fr? |
last post by:
Hi,
i have a website , on wich users have to log in
credentials are checked against mysql db
some session vars are set during login for use somewhere else in the
code.
Is there a way to prohibit a user to log in twice.
A was thinking about setting some flag in the db, but in that case i
need some timeout in case a pc can crash for instance so the user does
|
by: mrbog |
last post by:
Tell me if my assertion is wrong here:
The only way to prevent session hijacking is to NEVER store
authentication information (such as name/password) in the session.
Well, to never authenticate a user from information you got from the
session. Each secure app on a site must challenge the user for name
and password, each and every time the user accesses it (not just once
and then store it in the session). If a secure app is multi-page,...
|
by: Shamrock |
last post by:
Hi,
I need to write application which tell me
who is login. In example:
1. login as Shamrock
2. I see Shamrock login
3. someone login as Morbious
4. They both see : Shamrock & Morbious
5. Shamrock logout
6. Morbious refresh site and see only Morbious is logged
|
by: Mitul |
last post by:
Hi to all,
I am working on a site in which I need to check whether user is online
or not. If user successfully logged out then I can change status from
online to offline but if user do not logged out and close the browser
or session timeout then in both of the case I do not handle how to
change user's status from online to offline.
Please help me to overcome the problem. Looking forward to reply from
all of you.
|
by: pagates |
last post by:
Hi All,
This must be a simple question, but I just can't figure it out. I want to
know if the user is logged in programmatically. I tried to use the
LoginStatus control, but of course that only has a LoggedOut event, not a
LoggedIn event (why?).
If anybody has a sample, I'd be very grateful.
Thanks,
| |
by: fomalhaut |
last post by:
Hi All,
I am building a tool for one of our company's service desks, and one
of the functions I'm hoping to add is the ability to enter a username
and find what PC that user is currently logged into.
As AD doesn't store this kind of information, is there any source I
can get this information from?
Thanks,
|
by: Simon Gare |
last post by:
Hi all,
below is an insert statement on an asp page that stores the date and time
that a driver logged on, what I need is to check that they are now already
logged on fields are
SQL Server 2000
ID int
DRIVER_NO int
|
by: SmartPHP |
last post by:
Hi friends,
My problem is...i want to open an application on click of some link...but before opening that application i want to check if that application is already opened with some other login id or not....if it is already opened with some other id i want to show a warning message...
for example...suppose i want to open yahoo on click of some link...and suppose yahoo is having the restriction that at a time only one user can login from...
|
by: ascll |
last post by:
Greetings,
How to I know existing user already login to my website (using ASP.net 2.0,
MS Web Developer's login wizard)?
If the user already login, I would like to set the path for Hyperlink A to
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
| |
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |