ColumnPermissions - IEEE-Team-3/map GitHub Wiki
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).
- View Permission: Determines who can see tasks in a column.
- Edit Permission: Determines who can modify tasks in a column.
- Move Permission: Determines who can move tasks between columns.
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.
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 },
},
});
function setColumnPermissions(columnId, role, permissions) {
const permission = new ColumnPermissions({
columnId,
role,
permissions,
});
permission.save();
}