wekan / wekan

The Open Source kanban (built with Meteor). Keep variable/table/field names camelCase. For translations, only add Pull Request changes to wekan/i18n/en.i18n.json , other translations are done at https://app.transifex.com/wekan/wekan only.
https://wekan.github.io
MIT License
19.58k stars 2.84k forks source link

Feature Request: When adding/removing user to/from Team/Org, add/remove user to/from all boards of Team/Org with edit rights etc #4178

Open mfnalex opened 2 years ago

mfnalex commented 2 years ago

Hi, I encountered a very strange problem. Imagine you have a board that was assigned to an organization, or a team. All existing org/team members can now access it. However, when a new user registers, and I now assign the existing org/team to it, they are not able to edit the board. I have to add them manually. This can't be correct, right?

Another question on the side: what's the difference between organizations and teams anyway?

Thanks!

WeKan version: 5.78.0

Emile840 commented 2 years ago

Hi @mfnalex,

You are right, when adding a new user to a team already attached to a board, this new user is not taken into account automatically (the functionality is not yet done). But if you delete this team and add it back to this board, the new user will be taken into account.

For me, there is no difference between organizations and teams as they are construct today, I think, we have to define first the relationship between an organization and a team functionally speaking and then make technical changes corresponding (@xet7 what do you think about it).

mfnalex commented 2 years ago

Thanks for your reply :) This was driving me insane lol, it was always the same person who didn't have a working account. It would be nice if this could be fixed because having to manually remove and readd a team from EVERY board basically makes using teams useless for me.

xet7 commented 2 years ago

@Emile840

Yes adding this would be very helpful.

helioguardabaxo commented 2 years ago

Hi, guys!

Would be interesting if a team had a organization for department's board. But if was a multi department board, would stay in a parent org. Seems like this: image

xet7 commented 2 years ago

@helioguardabaxo

That kind of Teams/Orgs is already possible with current WeKan, by adding those persons to those Teams/Orgs. Current way to manage that at Admin Panel is simple enough.

But even thinking about sometime having that kind of random org chart creation feature seems a little scary. Maybe keep those org charts outside of WeKan?

xet7 commented 2 years ago

Hmm, just a correction, I think it's not scary after all. I presume creating that kind of org chart could most likely be done by just looking from database about who is at what team/org etc and showing the result in HTML page.

helioguardabaxo commented 2 years ago

I hadn't thought about graphics, but it's a good idea. The main idea is to create a hierarchy between orgs to make searching for teams easier. In my institution we have 4 hierarchical levels (pro-rectories, departments, coordinations and sectors). Organizing them is essential. Maybe it's the basis for an improvement in "My boards" with board filters by teams and orgs.

xet7 commented 2 years ago

@helioguardabaxo

I think you mean All Boards page? One possible way would be Organization/Teams/etc folders, like at Android/iOS you can drop app icon on top of another icon, so those will be in same folder. Or alternatively, have those folder structures pre-made with org structure. UCS did it that way, and WeKan has beginnings of similar but without any subfolders:

Univention_Management_Console

xet7 commented 2 years ago

Also similarly could be grouping at Admin Panel.

helioguardabaxo commented 2 years ago

Oh, yes! All boards... A panel similar this could be very beautiful and useful. In my case folder structures pre-made with org structure is better for collaboration boards. For personal boards, could have a "Personal" folder with a possibility to create sub folders.

xet7 commented 2 years ago

Yes, anyone can try to make some changes related to this and send PR.

helioguardabaxo commented 2 years ago

@xet7 Just for curiosity. I saw in other issue that you are working in a "Big picture". What is it mean?

xet7 commented 2 years ago

@helioguardabaxo

Big picture means:

WeKan did exists already when I started maintaining Wekan at 2016-12. After that it has been just adding features and fixes. This kind of big picture does not exist yet, I did not do any of original architecture and design.

helioguardabaxo commented 2 years ago

Thanks for the info. It's a important, complex and big work.

chrisi51 commented 1 year ago

Hi, I encountered a very strange problem. Imagine you have a board that was assigned to an organization, or a team. All existing org/team members can now access it. However, when a new user registers, and I now assign the existing org/team to it, they are not able to edit the board. I have to add them manually. This can't be correct, right?

Another question on the side: what's the difference between organizations and teams anyway?

Thanks!

WeKan version: 5.78.0

the original issue is still open, correct? i recently got into the trap to demote all boardadmins by removing and re-adding the organization. So you have to keep in mind to put the admin rights back to the board admins afterwards.

DarthJahus commented 7 months ago

Same problem. I've had to remove/add team so new team users had edit access to the board.

Note that only edit was missing before applying the workaround. Users could see the board and cards, but not create or edit anything.

chrisi51 commented 3 months ago

i've just asked chatGPT if it was a way to change the check for active user and add a check for team and organisation at https://github.com/wekan/wekan/blob/d04c5c9846f7beacb2144f4b91a332af8b724d60/models/boards.js#L742-L750 result is something like this.

isActiveMember(userId) {
  if (!userId) {
    return false;
  }

  const isActiveMember = this.members.find(
    member => member.userId === userId && member.isActive,
  );

  if (isActiveMember) {
    return true;
  }

  // Check if the user is part of any active team in this board
  const userTeams = Teams.find({ members: userId, isActive: true }).fetch();
  const activeTeams = this.teams.filter(team => team.isActive);
  for (let team of activeTeams) {
    if (userTeams.some(userTeam => userTeam._id === team.teamId)) {
      return true;
    }
  }

  // Check if the user is part of any active organization in this board
  const userOrgs = Organizations.find({ members: userId, isActive: true }).fetch();
  const activeOrgs = this.orgs.filter(org => org.isActive);
  for (let org of activeOrgs) {
    if (userOrgs.some(userOrg => userOrg._id === org.orgId)) {
      return true;
    }
  }

  return false;
}

If i understand correctly, the current way is to add ppl from teams or orgs to the regular userlist when u add or remove a team/org to a board. Than checking those user for permissions instead of checking for teams and orgs. So would that help, to check for teams and orgs too to make changes at teams or orgs instantly having effect?