added assertIsNotAnonymous methods to SecurityUtil

This commit is contained in:
Sebastian Sdorra
2011-02-11 19:06:11 +01:00
parent e6f5aa554f
commit 3f5969e885

View File

@@ -84,6 +84,35 @@ public class SecurityUtil
} }
} }
/**
* Method description
*
*
* @param contextProvider
*/
public static void assertIsNotAnonymous(
Provider<? extends SecurityContext> contextProvider)
{
if (isAnonymous(contextProvider))
{
throw new ScmSecurityException("anonymous is not allowed here");
}
}
/**
* Method description
*
*
* @param context
*/
public static void assertIsNotAnonymous(SecurityContext context)
{
if (isAnonymous(context))
{
throw new ScmSecurityException("anonymous is not allowed here");
}
}
//~--- get methods ---------------------------------------------------------- //~--- get methods ----------------------------------------------------------
/** /**