Domain model cordinality

28 Jan '17, 12:56 PM
4,897 Views
No Forum Badges

Hi,

 

The webratio is forced me to change the cardinality between the user,module and group to 1 to 1.

So  can not add multiple modules to a group.

 How can I fix it?

 

Thank you.

 
x 0
Follow
Answer Answer at this question and get points!
Forum Expert - Level 5

Hi,

the cardinality of the relationship between the User, Module and Group entities must not be changed, because they have a logical structure for the login procedure.

In fact, as it says in the article http://www.webratio.com/learn/learningobject/how-to-use-the-protected-modules:

"According to this model we can define several Users, each one connected to a default Group and to other Groups. Every defined Group is connected to a default Module and to other Modules. As said before, a Module is the representation of a part of the application with restricted access. In this way a user is connected to all the protected application parts to which he can have access, through the relationships with Groups (starting from the default Module of his default Group, to other Modules of other Groups). The meaning of the "User to Default Group" and the "User to Group" relationships and of the "Group to Default Module" and the "Group to Module" relationships is that when a user is identified (through the login), the information of his Default Group are gathered, along with the information of his Default Module. The result of this is that the user, after the login, is redirected to his default module. After the redirection, a user can then have access to all the protected Modules connected to his Groups."

Usually the default modile of a group refers to a particular Site View (e.g. "Administrator" Site View with "sv1" id), while all other protected modules connected to that group, you can add them in the table created for the relationship N to N "Group_Module". To see the table that refers to this relationship, in the Domain Model select the relationship, move to the Properties View, open the Mapping tab and you see the information about the table.

In addition to see an example of data and the login management, you can download the "Acme" sample project from the WebRatio Add-ons. To see the login management you can see the model and you can also generate it to test. Also if you open the script sql present in the Acme project -> SQL -> PrepareDB_MySQL.sql where you can see the data.

Best regards,

Ombretta

 
x 0
Answer at this question and get points!