Revision 5027
Added by daigle over 14 years ago
AccessControlTest.java | ||
---|---|---|
1570 | 1570 |
/** |
1571 | 1571 |
* Tests Tests a version 2.1.0 EML document when permission order is |
1572 | 1572 |
* denyFirst, the combination of allow and deny rules affect user to read, |
1573 |
* update and delete a document. Here are test cases 1.An user inserts a |
|
1574 |
* document with access rules (denyFirst) - allow READ rule for another |
|
1575 |
* user, deny READ rule for public. Another user reads this document - |
|
1576 |
* success Another user updates this document(except access part) -failure |
|
1577 |
* Another user updates this document(access part) -failure Another user |
|
1578 |
* deletes this document - failure 2. The user updates this documents with |
|
1579 |
* access rules (denyFirst) - allow READ and WRITE rule for another user, |
|
1580 |
* deny READ and WRITE rule for public. Another user reads this document - |
|
1581 |
* success Another user updates this document(except access part) -success |
|
1582 |
* Another user updates this document(access part) -failure Another user |
|
1583 |
* deletes this document - failure 3. The user updates this documents with |
|
1584 |
* access rules (denyFirst) - allow ALL rule for another user, deny ALL rule |
|
1585 |
* for public. Another user reads this document - success Another user |
|
1586 |
* updates this document(except access part) -success Another user updates |
|
1587 |
* this document(access part) -success Another user deletes this document - |
|
1588 |
* success 4. The user updates this documents with access rules (denyFirst) - |
|
1573 |
* update and delete a document. Here are test cases |
|
1574 |
* |
|
1575 |
* 1. A user inserts a document with access rules (denyFirst) - allow READ |
|
1576 |
* rule for another user, deny READ rule for public. Another user reads this |
|
1577 |
* document - success. Another user updates this document(except access part) |
|
1578 |
* - failure. Another user updates this document(access part) -failure Another |
|
1579 |
* user deletes this document - failure |
|
1580 |
* |
|
1581 |
* 2. The user updates this documents with access rules (denyFirst) - allow |
|
1582 |
* READ and WRITE rule for another user, deny READ and WRITE rule for public. |
|
1583 |
* Another user reads this document - success. Another user updates this |
|
1584 |
* document(except access part) - success. Another user updates this |
|
1585 |
* document(access part) -failure. Another user deletes this document - failure. |
|
1586 |
* |
|
1587 |
* 3. The user updates this documents with access rules (denyFirst) - allow |
|
1588 |
* ALL rule for another user, deny ALL rule for public. Another user reads |
|
1589 |
* this document - success. Another user updates this document(except access part) |
|
1590 |
* - success. Another user updates this document(access part) - success. Another |
|
1591 |
* user deletes this document - success. |
|
1592 |
* |
|
1593 |
* 4. The user updates this documents with access rules (denyFirst) - |
|
1589 | 1594 |
* allow READ and WRITE rule for another user, deny WRITE rule for public. |
1590 |
* Another user reads this document - success Another user updates this |
|
1591 |
* document(except access part) -success Another user updates this |
|
1592 |
* document(access part) -failure Another user deletes this document - |
|
1593 |
* failure 5. The user updates this documents with access rules (denyFirst) - |
|
1595 |
* Another user reads this document - success. Another user updates this |
|
1596 |
* document(except access part) - success. Another user updates this |
|
1597 |
* document(access part) -failure. Another user deletes this document - |
|
1598 |
* failure. |
|
1599 |
* |
|
1600 |
* 5. The user updates this documents with access rules (denyFirst) - |
|
1594 | 1601 |
* allow READ and WRITE rule for another user, deny READ rule for public. |
1595 |
* Another user reads this document - success Another user updates this |
|
1596 |
* document(except access part) - success Another user updates this |
|
1597 |
* document(access part) -failure Another user deletes this document - |
|
1598 |
* failure 6. The user updates this documents with access rules (denyFirst) - |
|
1602 |
* Another user reads this document - success. Another user updates this |
|
1603 |
* document(except access part) - success. Another user updates this |
|
1604 |
* document(access part) - failure. Another user deletes this document - |
|
1605 |
* failure. |
|
1606 |
* |
|
1607 |
* 6. The user updates this documents with access rules (denyFirst) - |
|
1599 | 1608 |
* allow READ rule for another user, deny READ rule for a group (which |
1600 |
* another user is in the group) Another user reads this document - success |
|
1601 |
* Another user updates this document(except access part) -failure Another |
|
1602 |
* user updates this document(access part) -failure Another user deletes |
|
1603 |
* this document - failure 7. The user updates this documents with access |
|
1604 |
* rules (denyFirst) - allow READ and WRITE rule for another user, deny READ |
|
1605 |
* and WRITE rule for a group (which another user is in the group) Another |
|
1606 |
* user reads this document - success Another user updates this |
|
1607 |
* document(except access part) - success Another user updates this |
|
1608 |
* document(access part) -failure Another user deletes this document - |
|
1609 |
* failure 8. The user updates this documents with access rules (denyFirst) - |
|
1609 |
* another user is in the group). Another user reads this document - success. |
|
1610 |
* Another user updates this document(except access part) - failure. Another |
|
1611 |
* user updates this document(access part) -failure. Another user deletes |
|
1612 |
* this document - failure. |
|
1613 |
* |
|
1614 |
* 7. The user updates this documents with access rules (denyFirst) - allow |
|
1615 |
* READ and WRITE rule for another user, deny READ and WRITE rule for a |
|
1616 |
* group (which another user is in the group). Another user reads this document |
|
1617 |
* - success. Another user updates this document(except access part) - success. |
|
1618 |
* Another user updates this document(access part) -failure. Another user deletes |
|
1619 |
* this document - failure. |
|
1620 |
* |
|
1621 |
* 8. The user updates this documents with access rules (denyFirst) - |
|
1610 | 1622 |
* allow ALL rule for another user, deny ALL rule for a group (which another |
1611 |
* user is in the group) Another user reads this document - success Another |
|
1612 |
* user updates this document(except access part) - success Another user |
|
1613 |
* updates this document(access part) - success Another user deletes this |
|
1614 |
* document - success 9. The user updates this documents with access rules |
|
1615 |
* (denyFirst) - allow READ and WRITE rule for another user, deny WRITE rule |
|
1616 |
* for a group (which another user is in the group) Another user reads this |
|
1617 |
* document - success Another user updates this document(except access part) - |
|
1618 |
* success Another user updates this document(access part) - failure Another |
|
1619 |
* user deletes this document - failure 10. The user updates this documents |
|
1620 |
* with access rules (denyFirst) - allow READ and WRITE rule for another |
|
1621 |
* user, deny READ rule for a group (which another user is in the group) |
|
1622 |
* Another user reads this document - success Another user updates this |
|
1623 |
* document(except access part) - success Another user updates this |
|
1624 |
* document(access part) -failure Another user deletes this document - |
|
1625 |
* failure |
|
1623 |
* user is in the group). Another user reads this document - success. Another |
|
1624 |
* user updates this document(except access part) - success. Another user |
|
1625 |
* updates this document(access part) - success. Another user deletes this |
|
1626 |
* document - success. |
|
1627 |
* |
|
1628 |
* 9. The user updates this documents with access rules (denyFirst) - allow |
|
1629 |
* READ and WRITE rule for another user, deny WRITE rule for a group (which |
|
1630 |
* another user is in the group). Another user reads this document - success. |
|
1631 |
* Another user updates this document(except access part) - success. Another |
|
1632 |
* user updates this document(access part) - failure. Another user deletes |
|
1633 |
* this document - failure. |
|
1634 |
* |
|
1635 |
* 10. The user updates this documents with access rules (denyFirst) - allow |
|
1636 |
* READ and WRITE rule for another user, deny READ rule for a group (which |
|
1637 |
* another user is in the group). Another user reads this document - success. |
|
1638 |
* Another user updates this document(except access part) - success. Another |
|
1639 |
* user updates this document(access part) -failure. Another user deletes |
|
1640 |
* this document - failure. |
|
1626 | 1641 |
*/ |
1627 | 1642 |
public void test210DenyFirst() { |
1628 | 1643 |
debug("\nRunning: test210DenyFirst()"); |
... | ... | |
2062 | 2077 |
|
2063 | 2078 |
/*************************************************************************** |
2064 | 2079 |
* Test the case when no access is specified and owner is logged in No |
2065 |
* online or inline data is involved -> an user inserts a document and is |
|
2066 |
* able to read it, update it, set permissions on it and delete it -> |
|
2067 |
* another user is not able to do anything with the document when no access |
|
2080 |
* online or inline data is involved |
|
2081 |
* |
|
2082 |
* 1) a user inserts a document and is able to read it, update it, set |
|
2083 |
* permissions on it and delete it. |
|
2084 |
* |
|
2085 |
* 2) another user is not able to do anything with the document when no access |
|
2068 | 2086 |
* is specified for that user -> test what all the other user can do when |
2069 | 2087 |
* read only, write only and change permissions only permissions are |
2070 | 2088 |
* specified |
... | ... | |
2072 | 2090 |
*/ |
2073 | 2091 |
public void document201Test() { |
2074 | 2092 |
try { |
2075 |
debug("\nRunning: document201Test()");
|
|
2093 |
debug("\ndocument201Test() : Starting");
|
|
2076 | 2094 |
String emlVersion = EML2_0_1; |
2077 | 2095 |
|
2078 | 2096 |
newdocid = generateDocumentId(); |
Also available in: Unified diff
Change MetaCatVersion to MetacatVersion