foundersandcoders / open-tourism-platform

An open platform to facilitate the creation of apps to promote local tourism and business in Nazareth
MIT License
17 stars 3 forks source link

verified key to Event and Place #179

Closed Karyum closed 6 years ago

Karyum commented 6 years ago

add a verified key to the database schema of the event and place, which would be a Bool and the default would be false.

but there are 2 questions that needs answering: 1) In the data entry there would an option hidden from the BASIC user and only shown to the SUPER and ADMIN user that would verify it straight away correct ? ( only when a BASIC user tries to add an email would be sent ) 2) what does this adding a key mean for out production database @des-des ?

Karyum commented 6 years ago

answering the questions above:

1) Instead of showing an option we would just do it automatically through the data-entry. the backend will check what is the role of the user who is currentley adding data and will toggle verified to true if he is ADMIN or SUPER, and false for when BASIC ( we might need to add an explanation about this in the docs ) should we also have something in the API that checks for the role @des-des ?

2) So to add the verified key to the collections of events and places that are already in production we would first backup the database, and then use mlab's API to make a PUT request and use $set: { verified: true } on the collections to add it

thoughts @des-des ?

des-des commented 6 years ago

@Karyum okay, for the db, once we have implemented the correct API functionality in OTP, rather than manipulating the db directly, we can just use postman and add verified to all the datapoints using the OTP API.

We need to add permissioning to the verified field in OTP, we already have functionality to do fine grained permissioning, so you just need to add the config for the correct controllers.

Further, we want 2 things,

  1. Some kind of endpoint (in I think best in data-entry) that when followed will directly set verified to true (For users with correct permissions who are logged in) - this will be for email
    1. Modify the data-entry UX so that you can toggle verified on something
Karyum commented 6 years ago

well first i should start by saying that all of the content in the API right now were set to verified true :grimacing: through making an API call to mlab straight away ( yeah also backed it up no worries :wink: )

I think this has also answered my comment https://github.com/foundersandcoders/open-tourism-platform/issues/178#issuecomment-370250060

  1. to go more on details on this we would have an endpoint in the data entry that will make a call to a different endpoint on the OTP API ( which will do the permissioning and and set verified to true ).
  2. can't we use the a tag that we added Here for this ??

i've also asked this here -> https://github.com/foundersandcoders/open-tourism-platform/issues/178#issuecomment-370250060 but where would we make the emails ?? ( might be rhetorical cause it would make sense to do it through the data entry i guess? )