As i am new to mongodb, I am doing a project of pharmacy management system in node and mongoDB.
I want to make a table ROLE in which i only state id and ROLE attribute {can be admin, can be customer}, and a table of user -> having attributes {id, name, contact, gender, role_id(make relation of role table to user)}.
A user can be a admin or customer at a time, there can be multiple customers...
How could i do this relationship query in database.
Related
I'm trying to set up Identity Server in a multi-tenancy environment but I'm struggling to get the ClientCredentials Grant Type and how I can audit record changes.
If I use the code flow grant type I obviously have a user & roles. I can then create an authorization policy based on the roles and the user. i.e. must be an authenticated user and have role "x".
As I have user data (and tenant data), I can then update my records with which user updated the record. e.g. Customer Bob was updated by user 999.
But how is this possible with an m2m account which I understand should use client credentials?
So Customer Bob is updated by the m2m account but who/what do I say updated the record? I understand that an m2m account doesn't have a user but something has still updated the customer record. I hope that makes sense.
I am orgadmin for my organization and wanted to create new user for one of the snowflake account. In primary URL i can create new user and role but how can be created for another account under organization umbrella?
Find the URL for the account you want to create the user.
Once you log in, you have to create the user in that account.
I am developing a web application for my school.
The fields of my Users table are
-Username
-Hashed_password
-Salt
-Role_ID
There are 6 roles in my Roles table
-Main Administrator
-Tech Administrator
-Faculty Administrator
-Career Administrator
-Student
-Graduated
My problem is, how can I manage that when a user with Faculty Administrator Role can see all the students and graduateds that are related to its faculty? (Faculty is another table)
And also, how can I manage that when a user with Career Administrator Role can see all the students and graduateds that are related to its career? (Career is other table)
Do I need to create another tables to give permissions to that faculty or career or how do I relation the faculty or career depending on the type of user?
In the user table you need to add ID_Career and ID_faculty, with this all the users have their career and their faculty, so if a user with Faculty Administrator Role wants to see all the students from his faculty or career you only need to take the correspondant ID and make the search for all the students that have the same ID_Faculty or ID_Career.
I have a question regarding 1 user belongs to 2 different user group in SQL Server and I am trying to manage object permission in the server.
In our database, there is one view with sensitive permission that only certain people can see it, and most of our user are manage in the group.
such as: Sales Group, Manager Group
Ideally, we want only grant permission to Manager Group and deny permission to all the other user,
Let's say manager John is in Manager group, but he is also in Sales Group since he is the manager in Sales department.
My understanding is, if 1 user in 2 different user group, if you deny permission to any of the group, even the user have granted permission in another, he can still not see the object.
How can I overcome this situation?
Thanks!
Replying my own question, we found the solution,
under database security, we can create database role, in database role we can assign single table permission to different role, then we assign database role to user group. in this case, ex.
there are 3 table in the database,
table A is the one with credential information. only manager can see
Table B and C is just the regular table.
create database role 'Normal Access' and grant permission to table B and C.
Then create another database role 'credential Access' and grant permission to table A.
in your Server level security. all the user group should only belong to 'Public', in Server roles level.
and in Use mapping, select the database and only choose the database role you assign.
in my case, Assign database role, 'Normal Access' and 'Credential Access' to Manager group. so he will have all the access to ABC table
Sales Group should only have 'Normal Access' so it cannot access A table.
thanks
I want to modal a use-case in neo4j.
UseCase :
User
Role
Department
Permission
Here a user can have multiple roles and user can be associated with multiple departments through multiple roles.
Ex:
User A is connected with Department X with role role A,role B and same user is connected to department y with role A and role c,further each role will have set of permissions.
Suggest neo4j data-model.
http://neo4j.com/docs/2.1.5/examples-user-roles-in-graphs.html and http://neo4j.com/docs/2.1.5/examples-acl-structures-in-graphs.html both provide a very good reference which you can consult to build up your model