ColumnPermissions - IEEE-Team-3/map GitHub Wiki

Overview

Column permissions allow users to control who can view or edit tasks in specific columns. This is particularly useful for restricting access to certain stages of tasks (e.g., review or completion stages).

Permission Types

  1. View Permission: Determines who can see tasks in a column.
  2. Edit Permission: Determines who can modify tasks in a column.
  3. Move Permission: Determines who can move tasks between columns.

Role-Based Permissions

Each role within the team can have different permissions for interacting with columns. For example:

  • Admins: Full access to all columns.
  • Team Members: May have restricted access to columns like "Review" or "Done."
  • Guests: Can only view the "To Do" column.

Example Permission Setup

const ColumnPermissionsSchema = new Schema({
  columnId: { type: Schema.Types.ObjectId, ref: 'KanbanColumn' },
  role: { type: String, enum: ['Admin', 'Member', 'Guest'], required: true },
  permissions: {
    view: { type: Boolean, default: true },
    edit: { type: Boolean, default: false },
    move: { type: Boolean, default: false },
  },
});

Example Backend Logic

function setColumnPermissions(columnId, role, permissions) {
  const permission = new ColumnPermissions({
    columnId,
    role,
    permissions,
  });
  permission.save();
}
⚠️ **GitHub.com Fallback** ⚠️