If I have a blank method in my object I am getting a MethodAccessException from the BusinessBas.IsSavable( ). I have blank methods from using the templates to generate my objects a month ago.
at System.Reflection.MethodBase.PerformSecurityCheck(Object obj, RuntimeMethodHandle method, IntPtr parent, UInt32 invocationFlags)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
at Csla.Security.ObjectAuthorizationRules.GetRoles(Type objectType)
at Csla.Security.AuthorizationRules.GetAllowEditRoles(Type objectType)
at Csla.Security.AuthorizationRules.CanEditObject(Type objectType)
at Csla.Core.BusinessBase.get_IsSavable()
In my BO:
private static void AddObjectAuthorizationRules()
{
// TODO: add authorization rules
//AuthorizationRules.AllowEdit(typeof(DataField), "Role");}
AddObjectAuthorizationRules
must be public in Silverlight.
Sergey Barskiy
Principal Consultant
office: 678.405.0687 |
mobile: 404.388.1899
Microsoft Worldwide Partner of the Year | Custom
Development Solutions, Technical Innovation
From: Jack
[mailto:cslanet@lhotka.net]
Sent: Friday, February 06, 2009 5:20 PM
To: Sergey Barskiy
Subject: [CSLA .NET] Silverlight MethodAccessException /w
ObjectAuthorizationRules
If I have a blank method in my object I am getting a MethodAccessException
from the BusinessBas.IsSavable( ). I have blank methods from using the
templates to generate my objects a month ago.
at
System.Reflection.MethodBase.PerformSecurityCheck(Object obj,
RuntimeMethodHandle method, IntPtr parent, UInt32 invocationFlags)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj,
BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo
culture, Boolean skipVisibilityChecks)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj,
BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo
culture)
at System.Reflection.MethodBase.Invoke(Object obj, Object[]
parameters)
at Csla.Security.ObjectAuthorizationRules.GetRoles(Type
objectType)
at Csla.Security.AuthorizationRules.GetAllowEditRoles(Type
objectType)
at Csla.Security.AuthorizationRules.CanEditObject(Type objectType)
at Csla.Core.BusinessBase.get_IsSavable()
In my BO:
private static void AddObjectAuthorizationRules()
{
// TODO: add authorization rules
//AuthorizationRules.AllowEdit(typeof(DataField),
"Role");
}
Sergey
Thanks – Is there a general rule of thumb here?
Jack
From: Sergey Barskiy
[mailto:cslanet@lhotka.net]
Sent: Friday, February 06, 2009 5:29 PM
To: jaddington@alexandergracie.com
Subject: RE: [CSLA .NET] Silverlight MethodAccessException /w
ObjectAuthorizationRules
AddObjectAuthorizationRules
must be public in Silverlight.
Sergey Barskiy
Principal Consultant
office: 678.405.0687 |
mobile: 404.388.1899
Microsoft Worldwide Partner of the Year | Custom
Development Solutions, Technical Innovation
From: Jack
[mailto:cslanet@lhotka.net]
Sent: Friday, February 06, 2009 5:20 PM
To: Sergey Barskiy
Subject: [CSLA .NET] Silverlight MethodAccessException /w
ObjectAuthorizationRules
If I have a blank method in my object I am getting a MethodAccessException
from the BusinessBas.IsSavable( ). I have blank methods from using the
templates to generate my objects a month ago.
at
System.Reflection.MethodBase.PerformSecurityCheck(Object obj,
RuntimeMethodHandle method, IntPtr parent, UInt32 invocationFlags)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj,
BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo
culture, Boolean skipVisibilityChecks)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj,
BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo
culture)
at System.Reflection.MethodBase.Invoke(Object obj, Object[]
parameters)
at Csla.Security.ObjectAuthorizationRules.GetRoles(Type
objectType)
at Csla.Security.AuthorizationRules.GetAllowEditRoles(Type
objectType)
at Csla.Security.AuthorizationRules.CanEditObject(Type objectType)
at Csla.Core.BusinessBase.get_IsSavable()
In my BO:
private static void AddObjectAuthorizationRules()
{
// TODO: add authorization rules
//AuthorizationRules.AllowEdit(typeof(DataField),
"Role");
}
The issue is that Silverlight’s reflection is limited in
the fact that you cannot call private members of a class from outside the class
itself. So, you could have two versions of the method – private for
.NET and public for SL, but that seems like an overkill to me, so I personally
just have one public method.
Sergey Barskiy
Principal Consultant
office: 678.405.0687 |
mobile: 404.388.1899
Microsoft Worldwide Partner of the Year | Custom
Development Solutions, Technical Innovation
From: Jack Addington
[mailto:cslanet@lhotka.net]
Sent: Monday, February 09, 2009 8:54 AM
To: Sergey Barskiy
Subject: RE: [CSLA .NET] Silverlight MethodAccessException /w
ObjectAuthorizationRules
Sergey
Thanks – Is there a general rule of thumb here?
Jack
From: Sergey Barskiy
[mailto:cslanet@lhotka.net]
Sent: Friday, February 06, 2009 5:29 PM
To: jaddington@alexandergracie.com
Subject: RE: [CSLA .NET] Silverlight MethodAccessException /w
ObjectAuthorizationRules
AddObjectAuthorizationRules
must be public in Silverlight.
Sergey Barskiy
Principal Consultant
office: 678.405.0687 |
mobile: 404.388.1899
Microsoft Worldwide Partner of the Year | Custom
Development Solutions, Technical Innovation
From: Jack
[mailto:cslanet@lhotka.net]
Sent: Friday, February 06, 2009 5:20 PM
To: Sergey Barskiy
Subject: [CSLA .NET] Silverlight MethodAccessException /w
ObjectAuthorizationRules
If I have a blank method in my object I am getting a MethodAccessException
from the BusinessBas.IsSavable( ). I have blank methods from using the
templates to generate my objects a month ago.
at
System.Reflection.MethodBase.PerformSecurityCheck(Object obj, RuntimeMethodHandle
method, IntPtr parent, UInt32 invocationFlags)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj,
BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo
culture, Boolean skipVisibilityChecks)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj,
BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo
culture)
at System.Reflection.MethodBase.Invoke(Object obj, Object[]
parameters)
at Csla.Security.ObjectAuthorizationRules.GetRoles(Type
objectType)
at Csla.Security.AuthorizationRules.GetAllowEditRoles(Type
objectType)
at Csla.Security.AuthorizationRules.CanEditObject(Type objectType)
at Csla.Core.BusinessBase.get_IsSavable()
In my BO:
private static void AddObjectAuthorizationRules()
{
// TODO: add authorization rules
//AuthorizationRules.AllowEdit(typeof(DataField),
"Role");
}
That is what I thought. So basically any internal CSLA methods
that could be called by the framework should really be public.
Is there any way to implement a set of compiler warnings that
would pick up on that stuff? Or just experience / trial & error?
From: Sergey Barskiy
[mailto:cslanet@lhotka.net]
Sent: Monday, February 09, 2009 7:06 AM
To: jaddington@alexandergracie.com
Subject: RE: [CSLA .NET] Silverlight MethodAccessException /w
ObjectAuthorizationRules
The issue is that Silverlight’s reflection is limited in the
fact that you cannot call private members of a class from outside the class
itself. So, you could have two versions of the method – private for .NET
and public for SL, but that seems like an overkill to me, so I personally just
have one public method.
Sergey Barskiy
Principal Consultant
office: 678.405.0687 |
mobile: 404.388.1899
Microsoft Worldwide Partner of the Year | Custom
Development Solutions, Technical Innovation
From: Jack Addington
[mailto:cslanet@lhotka.net]
Sent: Monday, February 09, 2009 8:54 AM
To: Sergey Barskiy
Subject: RE: [CSLA .NET] Silverlight MethodAccessException /w
ObjectAuthorizationRules
Sergey
Thanks – Is there a general rule of thumb here?
Jack
From: Sergey Barskiy
[mailto:cslanet@lhotka.net]
Sent: Friday, February 06, 2009 5:29 PM
To: jaddington@alexandergracie.com
Subject: RE: [CSLA .NET] Silverlight MethodAccessException /w
ObjectAuthorizationRules
AddObjectAuthorizationRules
must be public in Silverlight.
Sergey Barskiy
Principal Consultant
office: 678.405.0687 |
mobile: 404.388.1899
Microsoft Worldwide Partner of the Year | Custom
Development Solutions, Technical Innovation
From: Jack
[mailto:cslanet@lhotka.net]
Sent: Friday, February 06, 2009 5:20 PM
To: Sergey Barskiy
Subject: [CSLA .NET] Silverlight MethodAccessException /w
ObjectAuthorizationRules
If I have a blank method in my object I am getting a MethodAccessException
from the BusinessBas.IsSavable( ). I have blank methods from using the
templates to generate my objects a month ago.
at System.Reflection.MethodBase.PerformSecurityCheck(Object
obj, RuntimeMethodHandle method, IntPtr parent, UInt32 invocationFlags)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj,
BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo
culture, Boolean skipVisibilityChecks)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj,
BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo
culture)
at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
at Csla.Security.ObjectAuthorizationRules.GetRoles(Type
objectType)
at Csla.Security.AuthorizationRules.GetAllowEditRoles(Type
objectType)
at Csla.Security.AuthorizationRules.CanEditObject(Type objectType)
at Csla.Core.BusinessBase.get_IsSavable()
In my BO:
private static void AddObjectAuthorizationRules()
{
// TODO: add authorization rules
//AuthorizationRules.AllowEdit(typeof(DataField),
"Role");
}
Not that I am aware of.
Sergey Barskiy
Principal Consultant
office: 678.405.0687 |
mobile: 404.388.1899
Microsoft Worldwide Partner of the Year | Custom
Development Solutions, Technical Innovation
From: Jack Addington
[mailto:cslanet@lhotka.net]
Sent: Monday, February 09, 2009 9:19 AM
To: Sergey Barskiy
Subject: RE: [CSLA .NET] Silverlight MethodAccessException /w
ObjectAuthorizationRules
That is what I thought. So basically any internal CSLA
methods that could be called by the framework should really be public.
Is there any way to implement a set of compiler warnings that
would pick up on that stuff? Or just experience / trial & error?
From: Sergey Barskiy
[mailto:cslanet@lhotka.net]
Sent: Monday, February 09, 2009 7:06 AM
To: jaddington@alexandergracie.com
Subject: RE: [CSLA .NET] Silverlight MethodAccessException /w
ObjectAuthorizationRules
The issue is that Silverlight’s reflection is limited in
the fact that you cannot call private members of a class from outside the class
itself. So, you could have two versions of the method – private for
.NET and public for SL, but that seems like an overkill to me, so I personally
just have one public method.
Sergey Barskiy
Principal Consultant
office: 678.405.0687 |
mobile: 404.388.1899
Microsoft Worldwide Partner of the Year | Custom
Development Solutions, Technical Innovation
From: Jack Addington
[mailto:cslanet@lhotka.net]
Sent: Monday, February 09, 2009 8:54 AM
To: Sergey Barskiy
Subject: RE: [CSLA .NET] Silverlight MethodAccessException /w
ObjectAuthorizationRules
Sergey
Thanks – Is there a general rule of thumb here?
Jack
From: Sergey Barskiy
[mailto:cslanet@lhotka.net]
Sent: Friday, February 06, 2009 5:29 PM
To: jaddington@alexandergracie.com
Subject: RE: [CSLA .NET] Silverlight MethodAccessException /w
ObjectAuthorizationRules
AddObjectAuthorizationRules
must be public in Silverlight.
Sergey Barskiy
Principal Consultant
office: 678.405.0687 |
mobile: 404.388.1899
Microsoft Worldwide Partner of the Year | Custom
Development Solutions, Technical Innovation
From: Jack
[mailto:cslanet@lhotka.net]
Sent: Friday, February 06, 2009 5:20 PM
To: Sergey Barskiy
Subject: [CSLA .NET] Silverlight MethodAccessException /w
ObjectAuthorizationRules
If I have a blank method in my object I am getting a MethodAccessException
from the BusinessBas.IsSavable( ). I have blank methods from using the
templates to generate my objects a month ago.
at
System.Reflection.MethodBase.PerformSecurityCheck(Object obj,
RuntimeMethodHandle method, IntPtr parent, UInt32 invocationFlags)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags
invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean
skipVisibilityChecks)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj,
BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo
culture)
at System.Reflection.MethodBase.Invoke(Object obj, Object[]
parameters)
at Csla.Security.ObjectAuthorizationRules.GetRoles(Type
objectType)
at Csla.Security.AuthorizationRules.GetAllowEditRoles(Type
objectType)
at Csla.Security.AuthorizationRules.CanEditObject(Type objectType)
at Csla.Core.BusinessBase.get_IsSavable()
In my BO:
private static void AddObjectAuthorizationRules()
{
// TODO: add authorization rules
//AuthorizationRules.AllowEdit(typeof(DataField),
"Role");
}
Copyright (c) Marimer LLC