simplify WikiContexthasAdminPermissions()
@@ -74,7 +74,7 @@ public class WikiContext
private WikiEngine m_engine;
private String m_template = "default";
- private HashMap<String,Object> m_variableMap = new HashMap<String,Object>();
+ private HashMap<String,Object> m_variableMap = new HashMap<>();
/**
* Stores the HttpServletRequest. May be null, if the request did not
@@ -274,6 +274,7 @@ public class WikiContext
* {@inheritDoc}
* @see org.apache.wiki.ui.Command#getContentTemplate()
*/
+ @Override
public String getContentTemplate()
{
return m_command.getContentTemplate();
@@ -283,6 +284,7 @@ public class WikiContext
* {@inheritDoc}
* @see org.apache.wiki.ui.Command#getJSP()
*/
+ @Override
public String getJSP()
{
return m_command.getContentTemplate();
@@ -404,6 +406,7 @@ public class WikiContext
* Returns the request context.
* @return The name of the request context (e.g. VIEW).
*/
+ @Override
public String getRequestContext()
{
return m_command.getRequestContext();
@@ -424,6 +427,7 @@ public class WikiContext
* {@inheritDoc}
* @see org.apache.wiki.ui.Command#getTarget()
*/
+ @Override
public Object getTarget()
{
return m_command.getTarget();
@@ -433,6 +437,7 @@ public class WikiContext
* {@inheritDoc}
* @see org.apache.wiki.ui.Command#getURLPattern()
*/
+ @Override
public String getURLPattern()
{
return m_command.getURLPattern();
@@ -542,6 +547,7 @@ public class WikiContext
* @see org.apache.wiki.ui.PageCommand#getName()
* @see org.apache.wiki.ui.GroupCommand#getName()
*/
+ @Override
public String getName()
{
if ( m_command instanceof PageCommand )
@@ -644,6 +650,7 @@ public class WikiContext
* @since 2.1.37.
* @return A shallow clone of the WikiContext
*/
+ @Override
public Object clone()
{
try
@@ -742,6 +749,7 @@ public class WikiContext
* @return the permission
* @since 2.4
*/
+ @Override
public Permission requiredPermission()
{
// This is a filthy rotten hack -- absolutely putrid
@@ -779,6 +787,7 @@ public class WikiContext
*
* {@inheritDoc}
*/
+ @Override
public Command targetedCommand( Object target )
{
if ( m_command.getTarget() == null )
@@ -795,14 +804,8 @@ public class WikiContext
* @since 2.4.46
* @return true, if the user has all permissions.
*/
- public boolean hasAdminPermissions()
- {
- boolean admin = false;
-
- admin = m_engine.getAuthorizationManager().checkPermission( getWikiSession(),
- new AllPermission(m_engine.getApplicationName()) );
-
- return admin;
+ public boolean hasAdminPermissions() {
+ return m_engine.getAuthorizationManager().checkPermission( getWikiSession(), new AllPermission(m_engine.getApplicationName()) );
}
/**
