Open uleopold opened 10 years ago
The relationships described in this request reflect the present state of the database, but they do not seem to reflect exactly what is expected from iGUESS. For instance, issue #137 expects the city of Luxembourg to appear in different sites, thus the relationship between Sites and Cities must be many-to-many.
I will start by performing the changes required in issue #137 and only then come back to this issue.
I am not sure if we need it to be many-to-many, see my comment on #137 . I think, we should discuss first to ensure a common understanding.
I don't think you need to normalize the two (or more) cases where Luxembourg will appear in the database -- it makes things a lot simpler if you treat the Luxembourg in iGUESS as a separate city from the Luxembourg in Lamilo, for example.
If you normalize the cities, and create the many-to-many relationship, you will save a few bytes of data at the cost of a more complex data model. You'll need to track both city and instance for everything, which will complexify things a bit. You'll also lose the flexibility to have, for example, a different initial zoom level for Luxembourg in Lamilo (which might call for a more zoomed out, regional view), and iGUESS, which is more focused on the city itself.
Just my thoughts... It's your decision now!
Chris
On 8/28/2014 6:24 AM, Luís de Sousa wrote:
The relationships described in this request reflect the present state of the database, but they do not seem to reflect exactly what is expected from iGUESS. For instance, issue #137 https://github.com/CRTE/iguess/issues/137 expects the city of Luxembourg to appear in different sites, thus the relationship between Sites and Cities has to be many-to-many.
I will start by performing the changes required in issue #137 https://github.com/CRTE/iguess/issues/137 and only then come back to this issue.
— Reply to this email directly or view it on GitHub https://github.com/CRTE/iguess/issues/140#issuecomment-53718431.
I am handing back this issue since a re-design was set aside. It is better to assign the integration of instances into Devise to someone that can work longer on the project.
When a user logs in, devise (the module we are using for login management) checks if you have a valid name and password. If you do, you are logged in. Devise does not understand the concept of ¨instance¨ (iguess vs. lamilo vs. ecosystem-services, for example), and does not verify that your account is linked to the instance into which you are logging in.
Each account is attached to one city, and each city is attached to one instance, so it is easy to determine if a user should be able to log into any particular instance.
Devise needs to be modified to check that the user is logging into the correct instance, and to reject users who are logging into the wrong instance.