|
Hello,
I have a program that when a user logs in they will only be able to do certain things based on there user privilege. Example, low, medium, and full access.
If the user has low then they can only view, if the use has medium they can edit and add, if they have full then they can do everything.
The buttons will be disabled for actions that they cannot do.
In the database, i have entered their privileges as low, med, or full.
I am not sure if this is the best way to do this, but before each form is loaded, i check there privileges by quering the database. Then disabling button based on their user privilege.
As this is my first time i have done this, I would like to know how this is done in the real world. Is there is a more efficient method of doing this.
Many thanks in advance,
Steve
|
|
|
|
|
Hi Steve,
This is right approach.
In form load you have to check from database depending on user access rights, you can disable or invisible buttons.
Best Regards,
S Kumar
|
|
|
|
|
Hello,
Thanks for your answer, I wasn't sure about this. However, all those calls to the database might slow the program down.
I was thinking about setting a global variable in a class that is assigned their privilege from when they log in. Each form will just check from this global variable.
Thanks,
Steve
|
|
|
|
|
steve_rm wrote: Thanks for your answer, I wasn't sure about this. However, all those calls to the database might slow the program down.
I was thinking about setting a global variable in a class that is assigned their privilege from when they log in. Each form will just check from this global variable.
A lot depends on how much security you want in your app. Most of my internal applications, load the users profile settings at start-up and then I check the "global" profile object to find the permissons when needed. To add a bit more security, I reload the settings from database after an x number of minutes/form loads, just incase the users settings have been changed whilst they are in the app. It is a case of balancing speed of use against security.
|
|
|
|
|
Hello,
Thanks for your advice.
I was thinking of gettng there the privilege from when they log in and having that in a global variable.
However, I would like to do this in a very professional way that is both efficient and scalable. Is is possible to have groups of permissions and then assign a person to this group. Something that is very simliar to SQL Server.
Do you know of any online tutorials?
Thanks in advance,
Steve
|
|
|
|
|
In vb.net ,i have two forms.
in the first form progress bar and command button are added.
the second form contains a sqladapter,sqlconnection,dataset and a datagrid.
When click the command button in form1 ,the loading time of the form2 and database connection should be shown by the progress bar
|
|
|
|
|
Hi,
In form2, you can use code like form1.progressbar.value = 10 (some value depends on your procedure or function calls)
at last you can write
form1.proressbar.value = 100
Regards,
S Kumar
|
|
|
|
|
Hi there,
I am afraid that you can't do it because how do you know when the SQLadater finishes loading data into dataset.
There is only trick to do to this case is: after the SQLAdapter finished filling the dataset then you can use the counter to count the record in datatable and increase the progress bar by the count. when the iteration loop reach the last record then you can bind the grid to the datatable. However your users have to wait double times which might not be worth to add this fancy bell and wishle.
Have a happy coding
Paula
|
|
|
|
|
Hello VB.NET users,
I am very much new here. I have created 2 forms, form1 and form2. Each contains data grid. When the user in the form1-Datagrid say 7 the coulmn clicked the form2 with datagrid should open. When the user selects values from form2 pointer should go back to 7th coulmn and value should populate from form2(datagrid).
Please give me source code to my email address arun@albahar.ae
Regards
arun
|
|
|
|
|
Hi all,
I got a really big problem here. I am using VS.2005 to build our website.
How can i clear a seperate table when i close an application???
Shall i write the code in the Global.asax ??? just under the Application_End event!!
Or i can do something else to solve this problem???
Please help !!!
It is really urgent to me!!!
thanks
Jackie Ding
|
|
|
|
|
Hi Jackie,
Are you talking about database table, if yes then next time when user logs in that you can clear that table.
Regards,
S Kumar
|
|
|
|
|
Thanks Kumar,
Yes, I was talking about the Sql Database, and i store a list of product attributes in a seperate table, but this table is for users that haven't logged in yet. (i use this table just like use Cookies, but i don't use Cookies to store those information).
I was using "Application("ActiveUser")" to give each user that visits our website a sessionID, and then store something they choose in this seperate table, what i am doing is trying to delete all records belongs to a sessionID once the user leaves our website.
Please Help, thanks
Jackie Ding
|
|
|
|
|
Hi Jackie,
Your application might be like online shopping and users like Guest user.
If yo can keep track of signoff or logout then you can put that part of code in this code.
You can write code in session end of global.asax.
Regards,
S Kumar
|
|
|
|
|
Hi Kumar,
You are right, I am dong an online shoppingcart project.
I was trying to write code in session-end, but i really didn't how to write it. So could you please help??
i am trying to keep the session id increase by 1 each time, so that each user, even he hasn't login yet, can be seperated from other users, but the annoying thing is the session just repeat it again and again. For example, i run the website, and put something into a shoppingcart, and then leave without paying the money, and i do it for several times, but then the session number just start from 1 again, so the shopping cart doesn't only include current user's thing, but also the previous one's thing.
Now i am really really sad about it......, but still have no idea to fix it.
Have you got a MSN, I really need your help now, cause i am really in a hurry.
Please, Thanks
Jackie Ding
|
|
|
|
|
Try to write a subject that means something. What you have now is totally irrelevant to the question.
You don't have to create a session id yourself, there already is one. Use Session.SessionId. That will not start over when your application starts over.
You can put code to remove the data in the Session_End method in global.asax, that will take care of most sessions. You can not rely on it to remove the data from all sessions, though. There are some situations where that method might not be called. If you don't have too much traffic, you could take care of those manually, though.
---
b { font-weight: normal; }
|
|
|
|
|
Thanks Guffa,
I am trying what you said, but it doesn't work yet.
I set the datatype of the session.sessionID as nvarchar(MAX), but i am not sure whether i am right or wrong. I can input the sessionID into my database on the design page, but when i go to the shopping cart page, there is a big problem, says "Input string was not in a correct format", and "Source error: An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below".
So what can i do now? change the sessionID datatype to the uniqueidentifier?? but i think i did try, but failed as well.
Please help, thanks
Happy New Zealand Labour's day!!;)
-- modified at 19:00 Sunday 22nd October, 2006
Jackie Ding
|
|
|
|
|
I have several controls in a flow-layout panel which can be scrolled vertically. I dont want to scroll the flow-layout panel using mouse but it should scroll down when i click a button. How to do that?
Any hint?
.X.
|
|
|
|
|
My application used RichTextBox, I want it notify the color like VB.NET.
Example
If user use keyword Private it became blue
Thanks
................
|
|
|
|
|
All you have to do is search the articles. Second link down[^].
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
I want to use command to open as below
Read Mail
New message
Send Page
Thanks
................
|
|
|
|
|
Again - you've left out a LOT of detail that we need to answer this "question"...
Open what? Outlook? Outlook Express? Or are you trying to get at an SMTP/POP server in your own code? ...
Details man!! Details!! The quality of answer you get is directly tied to the quality of the question!
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
I want to open OutLook express(New Message, Inbox, Send page)
Thanks
................
|
|
|
|
|
I don't know how to do this
Add(text As String, image As System.Drawing.Image, OnClick As System.EventHandler) As System.Windows.Forms.TollStripItem
Thanks
-- modified at 22:32 Saturday 21st October, 2006
-- modified at 22:36 Saturday 21st October, 2006
................
|
|
|
|
|
This isn't a question. You want to do what with this?
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
i want to make a delay function in microseconds using vb 6 i am really stucked with that need it really quick .plz help me.
.o0|EvolvingLogics|0o.
|
|
|
|