Skip to content
Snippets Groups Projects
Commit 4fd360b2 authored by Jean-Vincent Drean's avatar Jean-Vincent Drean
Browse files

XWIKI-7687 : New bridge API to get a reference to the current user document

parent 53c8c3a6
No related merge requests found
......@@ -589,9 +589,19 @@ String getDocumentURL(final DocumentReference documentReference,
* Utility method to retrieve the current user.
*
* @return the current user full reference.
* @deprecated replaced by {@link org.xwiki.bridge.DocumentAccessBridge#getCurrentUserReference()}
*/
@Deprecated
String getCurrentUser();
/**
* Utility method to retrieve the current user document reference.
*
* @return the current user document reference.
* @since 4.0RC1
*/
DocumentReference getCurrentUserReference();
/**
* Utility method to set the current user.
*
......
......@@ -674,6 +674,7 @@ public boolean hasProgrammingRights()
}
@Override
@Deprecated
public String getCurrentUser()
{
DocumentReference userReference = getContext().getUserReference();
......@@ -686,6 +687,12 @@ public String getCurrentUser()
}
}
@Override
public DocumentReference getCurrentUserReference()
{
return getContext().getUserReference();
}
@Override
public void setCurrentUser(String userName)
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment