allow permissions with only a name (patch provided by Bob Ziuchkovski)
@@ -607,12 +607,22 @@ public final class Permissions
{
// System.out.println("\n\n|" + name + "|\n--\n|" + action + "|\n--\n" +
// target + "\n\n");
+ try
+ {
try
{
return (Permission) m_action.getConstructor(target,
new Class[] { String.class, String.class }).newInstance(
new Object[] { name, action });
}
+ // Fall-back to action-less constructor
+ catch (NoSuchMethodException ex)
+ {
+ return (Permission) m_action.getConstructor(target,
+ new Class[] { String.class }).newInstance(
+ new Object[] { name });
+ }
+ }
catch (Exception ex)
{
// TODO: log this or something
