Commit Graph

160 Commits

Author SHA1 Message Date
David Webster
80f7abbad0 RM-2197: Create REST GET API to return clearance levels
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@104246 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
2015-05-15 10:04:52 +00:00
Roy Wetherall
826a7d2403 Added 'hasClearance' method to SecurityClearanceService to support EntryVoter and AfterInvocationProvider implementations
* relates to RM-2129 & RM-2130
 * added 'getCurrentClassification" method to ClassificationService
 * added concept of system classification level "Unclassified" .. it no longer is required to be specified in the JSON bootstrap since this is a well known and alway required basic classification level
 * added concept of system security clearance level "No Clearance" .. automatically added and relates to unclassified classificaiton level
 * unit tests updated and added
 * started to move some of the logic out of unit test base class and into helper library called 'AlfMock'!



git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@104229 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
2015-05-15 03:21:08 +00:00
David Webster
a9f57ea03b RM-2120: Add error handling (and test) as suggested by Neil during + review RM-46
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@104157 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
2015-05-14 10:58:19 +00:00
Tuna Aksoy
130e8d104f RM-2206 (Dynamic test suite configuration)
+review RM-49

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@104045 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
2015-05-12 19:58:34 +00:00
Tuna Aksoy
3adf755829 RM-2206 (Dynamic test suite configuration)
+review RM-49

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@104044 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
2015-05-12 19:16:04 +00:00
Tuna Aksoy
237e44fb5b RM-2206 (Dynamic test suite configuration)
+review RM @rwetherall

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@104021 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
2015-05-12 15:22:11 +00:00
Tuna Aksoy
a2808e534e Fixed test name in the AllUnitTestSuite
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@103976 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
2015-05-11 14:38:03 +00:00
Tom Page
d60071421e RM-2197 Replace "No Clearance" with "Unclassified" in list of levels.
Created a notion of clearance level distinct from (but related to)
classification level. A clearance level references the highest
classification level it has access to. A SecurityClearance now contains a
ClearanceLevel, which in turn contains a ClassificationLevel.

Created a ClearanceLevelManager and initialise it at the same time as the
ClassificationLevelManager.

+review RM

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@103929 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
2015-05-11 08:16:03 +00:00
Tom Page
1c62f51937 Revert RM-2123 Update Java API to filter with current user's clearance.
The circular dependency causes a problem when loading the Spring context.
Reverting to rethink the approach.

+review RM-47



git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@103856 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
2015-05-08 09:26:27 +00:00
Tom Page
5927722e4d RM-2123 Update Java API to filter with current user's clearance.
+review RM

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@103851 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
2015-05-08 08:11:58 +00:00
David Webster
88ab2c282b RM-2120: Add unit test for usersecurityclearance.put webscript & add it (and get) to test suite
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@103829 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
2015-05-07 14:04:26 +00:00
David Webster
28d1294252 RM-2119: Update Java API to return the security clearance object when setting it.
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@103826 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
2015-05-07 13:58:16 +00:00
Tom Page
32cf73532c RM-2119 Don't need to explicitly apply the aspect.
By setting the property on the node the aspect will be applied
automatically if it hasn't already been applied.

+review RM-45

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@103786 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
2015-05-07 07:59:44 +00:00
Neil McErlean
47c161da65 Moer RM-2113 review comments. Renaming SecurityClearance.getClassificationLevel to getClearanceLevel
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@103782 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
2015-05-06 16:26:50 +00:00
Tom Page
a9bc2ea5c7 RM-2119 Java API to change a user's security clearance.
+review RM

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@103777 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
2015-05-06 15:27:35 +00:00
Neil McErlean
4d09db2085 Initial unit tests for RM-2113.
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@103745 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
2015-05-06 07:33:24 +00:00
Tuna Aksoy
2c9648f0aa RM-2114 (REST API to GET users security clearance)
+review RM-43

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@103743 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
2015-05-05 21:54:49 +00:00
Tuna Aksoy
3e2fd99f96 RM-2061 (Add classification properties to document details view)
RM-2062 (Add classification properties to record details view)

+review RM-29

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@102759 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
2015-04-27 13:45:05 +00:00
Tuna Aksoy
899cf5fad1 RM-2193 (Cannot classify non electronic document)
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@102702 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
2015-04-26 20:02:30 +00:00
Tom Page
07fc43cf29 RM-2045 Check that content is not re-classified.
Currently this is not supported, although it will be needed in the future.

Also take the opportunity to change the unit tests to use:
    when(x.y()).thenReturn(z));
rather than:
    doReturn(z).when(x).y();
This is because I noticed the javadoc for "doReturn" gives a good
explanation of when to use each (use the former whenever possible for
readability; use the latter if there's no choice).

+review RM-25

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@102231 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
2015-04-21 08:06:31 +00:00
Tom Page
96dbe7c160 RM-2045 Fix references to "document" to refer to "content".
We can use the same API to classify documents and records.

+review RM-25

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@102160 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
2015-04-20 09:04:01 +00:00
Tom Page
037e492cc9 RM-2045 Update unit test to use level ids, rather than levels.
+review RM-25

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@102158 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
2015-04-20 08:39:08 +00:00
Tom Page
9d888b256e RM-2045 Add validation that the node is a content node.
This is needed as the API method is specifically for content nodes. We
will deal with record nodes later, and possible folder nodes much later.

+review RM-25

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@102157 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
2015-04-20 08:39:06 +00:00
Tuna Aksoy
173c323665 RM-2047 (Set classification repository action)
* Unit test added

+review RM-28

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@102153 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
2015-04-19 19:49:22 +00:00
Tuna Aksoy
5122f5aceb RM-2045 (Java API to add a classification to a document)
* Changed the code to save the id's of classification reasons and levels
 
+ review RM-25

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@102118 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
2015-04-17 13:18:11 +00:00
Tom Page
19596e3484 RM-2045 Create Java API to classify a document.
Create dedicated objects to handle queries against the list of configured
classification levels and reasons.

+review RM-25

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@101986 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
2015-04-16 10:07:07 +00:00
Tuna Aksoy
d46ef8ef4b Fixed failing unit test
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@101803 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
2015-04-14 12:51:47 +00:00
Tom Page
3f866a031a RM-1947 New constraint to avoid invalid classification levels.
Create a service locator class to allow the non-Spring constraint to access
the Spring service.

+review RM-21

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@101788 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
2015-04-14 09:33:51 +00:00
Tuna Aksoy
11a515e666 RM-1842 (View users security clearance)
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@101590 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
2015-04-09 18:14:48 +00:00
Roy Wetherall
16d04e84b3 Reduce number of compilation warnings and re-format where nessesary.
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@101538 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
2015-04-09 01:58:11 +00:00
Tom Page
2ae7a18fc9 RM-1947 Restrict the classification levels shown to a user.
Currently we don't check what classification level the user has, and
instead assume that they have the highest security clearance. The work
to assign a security clearance to a user will be in RM-2112.

+review RM

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@101413 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
2015-04-08 14:55:58 +00:00
Tom Page
d7ab9b5480 Rename ExceptionUtils.intercept to expectedException.
+review RM-10

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@101338 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
2015-04-08 10:32:40 +00:00
Tom Page
b8e6ea3912 RM-2028 Create util method to validate classification fields.
Also change the freemarker script to use the built-in JSON escaping.

+review RM-14

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@101242 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
2015-04-07 13:55:42 +00:00
Tom Page
0deb734625 RM-2028 Add new test file to test suite.
+review RM-14

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@101116 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
2015-04-02 11:08:24 +00:00
Tom Page
6dce11ce59 RM-2028 Test for get classification reasons API.
+review RM-14

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@101108 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
2015-04-02 10:02:58 +00:00
Tom Page
60db7465ea RM-2027 Admin user is always "admin", system user is always "system".
+review RM-9

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@101018 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
2015-04-01 07:35:11 +00:00
Tom Page
420cecd0c7 RM-2027 Use annotations to create mocks in unit tests.
+review RM-9

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@100783 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
2015-03-31 10:09:31 +00:00
Tom Page
c93dba7c42 RM-2027 Add option to specify user names in MockAuthenticationUtilHelper.
+review RM-9

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@100775 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
2015-03-31 08:15:35 +00:00
Tom Page
f95eabd052 Wire the ClassificationServiceDAO using Spring injection.
Also small change to lower visibility of ClassificationServiceDAO member
variables from public to private.

+review RM @nmcerlean @rwetherall

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@100721 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
2015-03-30 14:49:10 +00:00
Tom Page
95262cfdc4 RM-2027 Make class logger static final.
Previously the logger wasn't final to allow it to be set for unit testing.
We're only testing it in the one test, so instead use a mock log4j appender
to check that the message is received.

+review RM-11

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@100717 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
2015-03-30 14:15:24 +00:00
Tom Page
ad7ae82746 Rename Configuration to ClassificationServiceDAO.
Also formatting changes as per code review comments.

+review RM-5

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@100687 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
2015-03-30 09:13:32 +00:00
Tom Page
a734159cee RM-2027 Unit testing for classification reason loading.
+review RM @nmcerlean

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@100355 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
2015-03-27 16:43:59 +00:00
Neil McErlean
266baccb9d Forgot to add previous new tests to the suite. Doing that now.
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@100312 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
2015-03-27 12:16:59 +00:00
Neil McErlean
720854e5f4 Helper class for dealing with exceptions in test code and some test code to test it. All based on Java 8.
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@100311 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
2015-03-27 12:14:56 +00:00
Tom Page
928d9b3190 RM-2027 Refactor mock authentication code.
Create a new class to handle creation of the mock authentication util.
It would be nice to always use it as a factory to create a mock util, but
unfortunately this causes many of the existing unit tests to fail. Something
clever is happening in org.mockito.MockitoAnnotations.initMocks(Object) that
I currently don't understand.

+review RM

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@100292 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
2015-03-27 11:30:20 +00:00
Neil McErlean
bb20d042cf Work on RM-2027. Addition of the Java API code to retrieve classification reasons and some of the test code associated with that. WIP. Test code not complete. +review RM
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@100255 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
2015-03-27 09:27:20 +00:00
Neil McErlean
22ead45f3f Refactoring test code to separate it from BaseUnitTest. RM-2027. +review RM
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@100172 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
2015-03-26 15:07:28 +00:00
Tom Page
d2ce0009d9 RM-2074 Bootstrap initial classification reasons.
+review RM

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@100134 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
2015-03-26 10:43:48 +00:00
Neil McErlean
5ae80ab2b1 Second and final tranche of post-code-review changes for RM-1945 & RM-1946.
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@100094 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
2015-03-25 19:39:09 +00:00
Tom Page
0d4ed55675 Add explicit mention that the mocked methods are generics using Objects.
These five lines were causing errors for me using Eclipse configured to
the Sun jdk1.8. Apparently there was no issue in IntelliJ and everything
worked fine from the command line before and after.

+review RM

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@100076 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
2015-03-25 15:31:08 +00:00