mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
RM-2440. Ensuring that users reclassifying content see the correct set of levels.
Added a new test case where an admin and an RM Manager (only cleared to secret) both try to reclassify a record. Added a new group (GROUP_RM_MANAGER_FILE_CATEGORY_ONE) for an RM Manager who can file records as well as read. Added some utility methods and fields. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@109524 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -63,6 +63,40 @@ public final class RMCollectionUtils
|
||||
return duplicateElems;
|
||||
}
|
||||
|
||||
/** Returns the head (element at index 0) of the provided List.
|
||||
*
|
||||
* @param l the list whose head is sought.
|
||||
* @param <T> the type of the List.
|
||||
* @return the head element or {@code null} for the empty list.
|
||||
* @throws NullPointerException if l is {@code null}
|
||||
*/
|
||||
public static <T> T head(List<T> l)
|
||||
{
|
||||
return l.isEmpty() ? null : l.get(0);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the tail of the provided List i.e. the sublist which contains
|
||||
* all elements of the given list except the {@link #head(List) head}.
|
||||
*
|
||||
* @param l the list whose tail is sought.
|
||||
* @param <T> the type of the List.
|
||||
* @return the tail sublist, which will be an empty list if the provided list had only a single element.
|
||||
* @throws NullPointerException if l is {@code null}
|
||||
* @throws UnsupportedOperationException if the provided list was empty.
|
||||
*/
|
||||
public static <T> List<T> tail(List<T> l)
|
||||
{
|
||||
if (l.isEmpty())
|
||||
{
|
||||
throw new UnsupportedOperationException("Cannot get tail of empty list.");
|
||||
}
|
||||
else
|
||||
{
|
||||
return l.subList(1, l.size());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This enum represents a change in an entry between 2 collections.
|
||||
*/
|
||||
|
Reference in New Issue
Block a user