Giter Site home page Giter Site logo

Comments (7)

yashshah1 avatar yashshah1 commented on August 10, 2024

I have a query, how are admins denoted in the database?
As far as I could tell, in the rooms collection, all users present in the users array are the admins of the room, so all of them must have the functionality, right?

from milaap.

yashshah1 avatar yashshah1 commented on August 10, 2024

I've added the backend for this feature in 72ec18a1433dee. I need some help as to where we can place the button in the UI, and whether or not to conditionally show it.

The backend takes care of whether the user is the admin or not.

For the front end, a possible roadmap is:

  • The backend route that serves the details of the room can also add a flag next to each user (I'm not sure if this is already done) denoting whether or not he's an admin or not.
  • Conditionally render a button to delete the room if that flag is true
  • Hit the route and on success redirect him to the homepage

from milaap.

Pranav2612000 avatar Pranav2612000 commented on August 10, 2024

I have a query, how are admins denoted in the database?
As far as I could tell, in the rooms collection, all users present in the users array are the admins of the room, so all of them must have the functionality, right?

Yes.

from milaap.

Pranav2612000 avatar Pranav2612000 commented on August 10, 2024

Yup. I think the approach works. We could add a flag next to each room in the users table denoting if he's an admin of the room or a guest. Where do you plan on rendering the "Delete room" button?

from milaap.

naman-modi avatar naman-modi commented on August 10, 2024

"Delete Room" functionality can be similar to "Invite" functionality visible only to admins.

We could add a flag next to each room in the users table denoting if he's an admin of the room or a guest.

From UI point of view, there's no need for this, as for now, only the rooms which the user is an admin of is displayed on the left sidebar.

I think delete room can be rendered with all other elements only, as the user can delete whenever he/she wants to delete it.

from milaap.

yashshah1 avatar yashshah1 commented on August 10, 2024

From UI point of view, there's no need for this, as for now, only the rooms which the user is an admin of is displayed on the left sidebar.

Correct me if I'm wrong but, afaik to render the button "Delete", the component will need some flag denoting whether or not the current user has permissions. Is there any other way I can find out?

@Pranav2612000 take a look at 5ac0fb848a6cc7b6e6ba54, this should cover what we spoke about.

I'll start working on the UI tomorrow.

from milaap.

Pranav2612000 avatar Pranav2612000 commented on August 10, 2024

If the room is present in the rooms' array in the users' table, then the user is an admin of the room. The guest rooms he visits are not stored here.

from milaap.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.