Tom Page
43a2784387
Use mock in unit test for ClearanceLevelManager.
...
Although I'm not sure exactly why this unit test failed on the Sonar build,
it seems sensible to remove the dependency on another class by using a mock.
+review RM
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@105192 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
2015-06-01 07:59:10 +00:00
Tom Page
655a8d8a5d
RM-2123 Ensure user has clearance to classify content.
...
Also add clearance check method into security profile.
+review RM-58
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@104750 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
2015-05-22 13:20:00 +00:00
Tom Page
eafaad25ea
RM-2123 Use runAsAuthentication instead of actual authentication.
...
Check that the user the command is run as has clearance to view the
classification levels, rather than the user that initiated the command.
+review RM-58
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@104729 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
2015-05-22 08:43:12 +00:00
Tom Page
94c65b83e8
RM-2123 Move clearance checking to SecurityClearanceService.
...
Refactor ContentClassificationService#hasClearance so that it calls out to
SecurityClearanceService#isCurrentUserClearedForClassification. Restrict
isCurrentUserClearedForClassification so that it only applies to the current
authenticated user (we don't need to use it for anything else). Also
extract classification level comparison to a new class.
+review RM-58
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@104568 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
2015-05-20 08:28:46 +00:00
Tom Page
4d94c8b66b
RM-2123 Don't create a user called system.
...
Also add special check in clearance service that gives system user maximum
clearance.
+review RM-58
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@104480 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
2015-05-19 09:57:02 +00:00
Tuna Aksoy
62558fbbc1
Removed warnings
...
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@104477 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
2015-05-18 21:24:33 +00:00
Neil McErlean
2c7885cfc6
Added some javadoc to clarify that ExceptionUtils.expectedException doesn't try to work around checked exceptions.
...
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@104391 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
2015-05-18 15:11:16 +00:00
Tom Page
f03e36ee91
RM-2123 Give clearance to the admin and system users.
...
Make sure this is executed as a patch and also bootstrapped into a clean
system using the BootstrapImporterModuleComponent.
Also restrict access to the classification levels (via the get API) to
only the levels that the user has clearance to.
+review RM
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@104376 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
2015-05-18 15:03:59 +00:00
Tom Page
24780dc472
RM-2123 Create a new service for content classification.
...
Move methods to do with content from the ClassificationService and the
SecurityClearanceService into the ContentClassificationService.
Remove the dependency of SecurityClearanceService on ClassificationService
which will allow us to reverse this dependency in the next commit. This is
needed in order to filter classifications by the current user's clearance.
Nb. This included adding a method in the SecurityClearanceService called
isClearedForClassification, which looks quite similar to a new API Roy
created hasClearance (see ContentClassificationService). In the future we
should look to see if we can consolidate these.
Remove dependency of ClassificationServiceBootstrap on the services, so that
it can be passed into them. This allows us to provide access to the POJO
managers in the services (this is made harder as the POJO managers aren't
Spring beans). In order to initialise these objects, change the POJO
managers to use setters rather than constructor arguments. This allows us
to store a reference to the manager before the data has been loaded.
Move the attribute service keys for classification levels and reasons into
the ClassifiedContentModel.
Expect NO_CLEARANCE to be passed into the ClearanceLevelManager, as
otherwise we have to have logic to exclude it (see initialise in the old
SecurityClearanceService) and then more logic to include it again (see the
old constructor for ClearanceLevelManager).
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@104375 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
2015-05-18 15:03:57 +00:00
David Webster
d42c0cabdd
RM-2197: Adds missing unit tests, as identified by Tom during +review RM-56
...
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@104306 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
2015-05-15 16:09:36 +00:00
David Webster
2714c77cec
RM-2120: More accurate error checking in test, as almost suggested by Neil during +review RM-46
...
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@104296 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
2015-05-15 14:51:56 +00:00
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