Page 1 of 1

Database login

Posted: Wed Nov 28, 2012 12:37 pm
by Nibor
Hi,
maybe someone can help me with my little LiveCode problem.
I want to create a tool where you can write data into your database and view the data which is in your database.
Well this isn't the problem.. the problem is, that this tool should have a login for seperate users
and every user got it's specific rights.
For example:
User 1 can only see the data which is in the database
User 2 can create new database entry but is not allowed to delete
User 3 can delete and see the data
User admin is allowed to do everything

I can't find anything in the dictonary or something that helps me
to connect the rights with the specific usergroups.

(I'm using mssql windows 64bit
don't know it it matters)

regards

Nibor

Re: Database login

Posted: Wed Nov 28, 2012 1:26 pm
by Klaus
Hi Nibor,

1. welcome to the forum :D

2. I would put the current user (1,2,3, or admin) into a global variable or custom property and en-/disable
your buttons "new entry" resp. "delete entry" accordingly, maybe in an "pre-/opencard" script. Know what I mean?

A quick and clean solution I think 8)


Best

Klaus

Re: Database login

Posted: Wed Nov 28, 2012 1:57 pm
by Mark
Hi Nibor,

MSSQL has a built-in feature for this. You can create users with special permissions. You set these permissions when executing the CREATE USER command. Once you have created the users, you can log in to your database with these users and you're sure that each user can only do what you allow them to do.

Kind regards,

Mark

Re: Database login

Posted: Wed Nov 28, 2012 2:37 pm
by Nibor
Klaus wrote:Hi Nibor,

1. welcome to the forum :D

2. I would put the current user (1,2,3, or admin) into a global variable or custom property and en-/disable
your buttons "new entry" resp. "delete entry" accordingly, maybe in an "pre-/opencard" script. Know what I mean?

A quick and clean solution I think 8)


Best

Klaus
Hi Klaus,
it is a good solution, but in my case there are more than one user in each group.
For example:
user1 is in group "admin"
user2 is in group "admin"
user3-7 is in group "create; no delete"
user8-10 is in group "only view"

as far as I understand your solution, I would have just one user per group.

I tried to create a new table in my database and added a few new users with a column for group and a column for userid.
In another table I added the userid aswell as the username, name and the password.
Now I would like to connect these tables in LiveCode so that each user can do what I gave them the rights for.
I'm able to add new users with password and so on.

kind regards

Nibor

Re: Database login

Posted: Wed Nov 28, 2012 3:27 pm
by Klaus
Nibor wrote:Hi Klaus,
it is a good solution, but in my case there are more than one user in each group.
For example:
user1 is in group "admin"
user2 is in group "admin"
user3-7 is in group "create; no delete"
user8-10 is in group "only view"
as far as I understand your solution, I would have just one user per group.
My solution was just a proposal and could certainly be enhanced to fit your needs!
Just check the GROUP in your case and not the users 8)
Nibor wrote:I tried to create a new table in my database and added a few new users with a column for group and a column for userid.
In another table I added the userid aswell as the username, name and the password.
Now I would like to connect these tables in LiveCode so that each user can do what I gave them the rights for.
I'm able to add new users with password and so on.
Hm, I thought you meant a Livecode solution, but you come up with a "real" database solution :D

Can't you connect to the correct tables according to the technique explained above?
Or just create different "edit" or "access" cards for the different groups?
Know what I mean?


Best

Klaus