Commit Graph

199 Commits

Author SHA1 Message Date
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
Neil McErlean
0cfc1a98bf First updates following code review on RM-1945 & RM-1946. Thanks Roy & Tom!
Renamed a public service method to getClassificationLevels.
Removed a redundant test method.
Code tidying.
Various internal renames to help readability.
Slight javadoc improvements.
Also some trivial changes like fixing typos and copyright years etc.
Removing warnings from within AuthenticationUtil blocks allows IntelliJ to fold them to Java 8 closure format. (fistpump).  


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@100020 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
2015-03-24 21:15:22 +00:00
Neil McErlean
43ada602f5 More tidyup following RM-1945 & RM-1946. The maven-based build did not define a test-resources directory for unit-test code. Now it does.
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@100018 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
2015-03-24 20:19:33 +00:00
Neil McErlean
9189987e91 Added unit tests to test suite for RM-1945 and RM-1946.
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@99995 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
2015-03-24 17:06:34 +00:00
Neil McErlean
aee333172a Initial creation of ClassificationService, as part of RM-1945 and RM-1946.
This check-in adds the basic ClassificationService API, its initial implementation, ClassificationServiceImpl, along with some basic support types such as ClassificationServiceException (for service-specific exceptions) and Configuration.
It also adds unit tests ClassificationServiceImplUnitTest and ConfigurationUnitTest.

The ClassificationService begins our support for ‘Classified Records’, whereby Alfresco content can be given a ClassificationLevel and thereafter will only be accessible to users with the appropriate security clearance.

The vanilla service includes a default set, rm-classification-levels.json (Top Secret etc) which links through to the i18n’d display data via rm-classification.properties in the usual way.

The service is defined in its own spring context file, rm-classified-records-context.xml, as it is distinct from the file plan and should be applicable to content outside that file plan.



git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@99932 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
2015-03-23 18:22:26 +00:00
Roy Wetherall
860e07b25a Merged V2.2 to V2.3:
99471: RM-2058: RM Manager can't access Users and Groups (after upgarde)



git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/BRANCHES/V2.3@99472 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
2015-03-16 00:17:26 +00:00
Roy Wetherall
af6f894ed0 Prevent incompatiable disposition schedules from being linked together
* the unpredicatable behaviour was caused by this incompatibility and the resulting uncertaintity over which level of dispostion would 'win'
  * RM-1963: It is not possible to cut off record scheduled for cut off if it's linked to a folder with disposition schedule with cut off step set on folder.
  * RM-1962: The disposition schedule steps are not working as expected on a record linked to a folder with disposition schedule on it's own.



git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/BRANCHES/V2.3@97948 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
2015-02-25 00:25:33 +00:00
Roy Wetherall
890dd9417c RM-1956: Create record capability allows user to edit metadata and copy category/folder /record
* fixes issue relating to filing records with only CreateRecord capability



git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/BRANCHES/V2.3@97945 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
2015-02-24 21:38:10 +00:00
Roy Wetherall
fc3fb36a3b Attempt to fix failing Unit Tests that are passing locally.
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/BRANCHES/V2.3@97788 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
2015-02-24 00:07:08 +00:00
Roy Wetherall
ca1f697f45 RM-1972: Methods with invalid policy are granted access
* invalid policy defintions now throw exception .. previously they just granted!
  * invalid capability definitions now throw exception .. previously they abstained with no message
  * reference to RM.Write removed and replaced with RM.Create or more appropriate permission check
  * adjustments to hold capabilities since they wheren't being exercised as we thought
  * ManageAccessRights no longer checks for frozen .. you should be able to manage the permissions of an object if it's frozen and you have the capability
  * Unit tests for new code and adjustments
  * Tweaks to existing integration tests where required



git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/BRANCHES/V2.3@97786 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
2015-02-23 23:02:09 +00:00
Roy Wetherall
552359138e RM-1864: New version is created when "Declare as version record"
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/BRANCHES/V2.3@97108 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
2015-02-16 02:08:54 +00:00
Tuna Aksoy
31fb488b0c RM-978 (Unable to navigate to copied folder from a collaboration site to RM site)
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/BRANCHES/V2.3@94453 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
2015-01-30 13:17:30 +00:00