BoardMembership¶
Bases: BoardMembership_
Interface for interacting with planka Board Memberships
Note
Only memberships that the current user has manager access to can be seen
Source code in src/plankapy/interfaces.py
1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 |
|
board
property
¶
Board that the membership is associated with
Returns:
Name | Type | Description |
---|---|---|
Board |
Board
|
Board instance |
user
property
¶
delete()
¶
Deletes the board membership relation
Danger
This action is irreversible and cannot be undone
Returns:
Name | Type | Description |
---|---|---|
User |
tuple[User, Board]
|
The user that was removed from the board |
Source code in src/plankapy/interfaces.py
1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 |
|
refresh()
¶
Refreshes the board membership data
Source code in src/plankapy/interfaces.py
1542 1543 1544 1545 1546 |
|
update(*args, **kwargs)
¶
update()
update(boardMembership: BoardMembership)
update(role: BoardRole = None, canComment: bool = None)
Updates the board membership with new values
Tip
Use .editor()
context manager to update the board membership with the user as an editor
Example:
>>> with boardMembership.editor():
... boardMembership.role = 'editor'
>>> boardMembership
BoardMembership(userId='...', boardId='...', role='editor', canComment=True)
Warning
canComment will always be set to True if the role is 'editor', if a context is used as a user is switched to a viewer, they will maintain their ability to comment unless explicitly set to False
Example:
>>> boardMembership.role
'editor'
>>> with boardMembership.editor():
... boardMembership.role = 'viewer'
>>> boardMembership.canComment
True
>>> # Using .update() will not automatically set canComment to False
>>> # on role change unless specified
>>> boardMembership.update(role='viewer')
>>> boardMembership.canComment
False
Parameters:
Name | Type | Description | Default |
---|---|---|---|
role
|
BoardRole
|
Role of the user in the board (default: None) |
required |
canComment
|
bool
|
Whether the user can comment on the board (default: None) |
required |
Alternate
Name | Type | Description | Default |
---|---|---|---|
boardMembership
|
BoardMembership
|
Board membership instance to update with |
required |
Returns:
Name | Type | Description |
---|---|---|
BoardMembership |
BoardMembership
|
Updated board membership instance |
Raises:
Type | Description |
---|---|
ValueError
|
If the role is invalid (must be 'viewer' or 'editor') |
Note
If no arguments are provided, the board membership will update itself with the current values stored in its attributes
Source code in src/plankapy/interfaces.py
1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 |
|