How to save users data in a Tiered application (separated dbcontext for identity server and application/module) - abp

I have a question regarding an application that I am developing, I try to implement a Kanban solution.
I have separated the IdentityServer (Users, Roles, etc), from the module/app that I am implementing. (Tiered)
I would like to know how I should do to have user data in the module/app.
I mean, it should have the "duplicate" users table or from the module/app can refer to the context of the identityServer database...
I am a bit lost...
For trying to give an example.
IdentityDbContext { Users, Roles, etc }
ApplicationDbContext { Board, Columns, Tags, Cards, CardUser, ¿User? }
In CardUser I would like to have the users related to Card (an N-M relationship).
But I don't know if I should create an entity/DbSet in the ApplicationDbContext or just save the UserId and then for each UserId query data to db or do call to api to the IdentityServer.
I think it's hard for me to explain myself, I'm sorry if it doesn't make sense, I appreciate any kind of help/comment.
Thank you very much.

As per best practices, aggregate root can be referenced by its id, but it is recommended not to reference it with the navigation property.
We have implemented a similar case for EventHub. You can see how we implemented it from the links below.
https://github.com/abpframework/eventhub/blob/e19c32731655df8c78d082a84cb336263c5f081a/src/EventHub.Domain/Events/Speaker.cs#L10
https://github.com/abpframework/eventhub/blob/e19c32731655df8c78d082a84cb336263c5f081a/src/EventHub.Application/Events/EventAppService.cs#L366
You can try to create an Event to better understand the requirements of EventHub.
https://www.openeventhub.com/

Related

FaunaDB, make connection between different users, I.e. become friends

I have a use case where I want to connect two different user roles, and if they accept and want to connect, new features will open up. It is very similar to how friend requests work at Facebook or LinkedIn, opening up and showing more content. Let's call them role1 and role2.
All users are stored within a "users" collection with an id. Depending on their provided role within the document attached to the "users" collection, they can store additional data in their respective role-collection, i.e., role1 collection or role2 collection.
What is the best approach and structure to connect the two users, i.e., become "friends"? Should I have the connection stored in a new collection, named perhaps connections-collection, or multiple collections?
I'm using Next.js, NextAuth for user authentication, and FaunaDB as a database. I'm using Fauna's query language, FQL.
Have you perhaps seen fireship's video RE: fauna db? I think it covers what you want to do and how you can proceed.
Edit: There are many ways to implement this. Based on my understanding, perhaps you can have "Friends" and "Requests" arrays stored under a user document. That way you can differentiate between confirmed friends or a just request.
Example: When user1 initiates a friend request with user2, you store user1's ref under "Requests" of user2's document. When user2 confirms, you move user1's ref to the "Friends" array.
This is just a overly simplified idea and you may need to consider your options and the implications. You would need to plan and define the predicate in both roles so you would only see what is necessary.

Managing user accounts for different sites with one database

We now have one site running but we will need to build a branded site for our client soon. The client site will have exactly the same data set as our current site expect for the user data. The client site must have totally separated user info which allows only the client to use the site.
I don't see the need for setting up a new database or creating a new user table for the client. My tentative solution is add a "Company" column for the user table so that I can differ which site the user data row is on.
I do not know if this approach will work or not or if it is the best practice. Could anyone with experience like this shed some light on this question?
Thanks,
Nigong
P.S. I use LAMP with AWS.
Using an extra column to store a company / entity id is a common approach for multitenant system. In general you will want to abstract the part that that verifies you can only retrieve data you're allowed to a piece that all queries go through, like your ORM. This will prevent people new to the project from exposing/using data that shouldn't be exposed/used.

Authentication with two different tables

I was working with Yii1 and for the authentication a was working with a "webuser extends CWebUser and in "UserIdentify" i was testing in access Level column in admins table, and if the user isn't in this table i search the user in Users Table.
So it was very simple to use it
Now with yii2, things become very different. I don't know from where i begin.
So if someone have an idea in how to authenticate from different tables it wil be very helpful.
Regards,

Alternative choices beside Silverlight AspDotNetMembershipProvider

i'm doing with silverlight 4 for consultation booking system. what i wondering is, in my application required multiple kind of user register and login. admin having different format of admin ID, lecturer having different format of lecturer ID. i'm trying to implement with silverlight for role and authentication merchant. i think might because of silverlight membership can be done easily with asp.netmembershipprover, i could not find any resource to edit the default form for it or custom made the membership merchant for my application. may i know is there any article or resource you know on how to implement this, or any idea you can suggest to me ?? Thank you
Resources i found:
http://www.silverlight.net/learn/graphics/file-and-local-data/isolated-storage-(silverlight-quickstart)
i thinking of using the isolated storage to store the user logged in boolean but sound like not so secure
http://msdn.microsoft.com/en-us/library/ee942451(v=vs.91).aspx
the resources mention of using the default asp.net membership but no comment on how to edit the default set.
You can use default MembershipProvider to manage general user information such as username, password, security question, login etc. Then you create additional table to store your own information, of course you need to create Page to manage these data by yourself.
Table: aspnet_users
UserId
UserName
...
Table: YourCustomData
UserId
AdminId
AdminText
...

Suggestions for creating a multi-blog site in CakePHP with ACL 'memberships'

I've been diving into CakePHP this year and I'm loving it! However, I've just run across a problem that I'm not sure how to handle. My database design is this--
USER can belong to one or more WEBSITE
A WEBSITE can have many USER
So I have a many-to-many relationship which is tracked in MEMBERSHIP
MEMBERSHIP also tracks what group_id the USER has for that WEBSITE.
For example, if user1 joins website3 as an administrator and website5 as a editor, then the MEMBERSHIP table has an entry reflecting both those roles.
Basically my problem is Cake's ACL. In the above-mentioned model, user1's group_id would change depending on which WEBSITE he's selected after logging in. (And he could subsequently change to even more websites within the dashboard by changing the group_id again and again). Cake's ACL appears to only handle 'user belongs to one group' period.
Can I trick the ACL by giving it the group_id from the session every time its changed and then reload the AROs? Would it make more sense to scrap ACL and create my own permissions module?
Any suggestions or ideas to point me in the right direction would be GREATLY appreciated!
i think it will be the best way to create your own permission module.
the reasons are quite simple:
you can modify/extend it in any way YOU want
you will not break any cakePHP specifications

Resources