Pass C# class without DisableSecurity?

Apr 6, 2011 at 8:16 PM

Maybe I'm going about this all wrong, but I'm trying to pass my own C# class to a script, but I don't want to have all the security issues involved with DisableSecurity.

Or maybe there is a way to pass an array of items, with each item containing either a KeyValuePair or the way I was doing it, using 2 arrays and a JS function to return the value of a specific key.

I'm basically trying to pass data from database, each row containing column names and values.

Apr 8, 2011 at 1:54 AM
Edited Apr 8, 2011 at 1:54 AM

I ended up using CAS since SharePoint (The platform I'm using this with) uses IPermission as well..

je.AddPermission(new SharePointPermission(System.Security.Permissions.PermissionState.Unrestricted));


As far as I can tell, the script has access to all the resources the user would have without having access to things like the file system.

Still would be nice to maybe have an attribute you could add to a class marking it as safe to use with scripts.