Quantcast
Channel: C1 CMS Foundation - Open Source on .NET
Viewing all articles
Browse latest Browse all 2540

New Post: Datfolder permissions

$
0
0
Thanks burningice! I still don't fully get how it works to be totally honest. I had no clue what the providerName should be or about the interfaceType because my generated datatype doesn't have an interface -- its a concrete type. However, with that said i was able to get it working with some educated guesses.

var a = new AssociatedDataElementProviderHelperEntityToken(TypeManager.SerializeType(typeof(IPage)), "PageElementProvider", page.Id.ToString(), TypeManager.SerializeType(typeof(Content.MyDataType)));
var permTypesNone = GetPermissionTypes(new UserPermissions() { PermissionTypes = new List<string>() { }, UserName = user.Username });
var perm = new ConstructorBasedUserPermissionDefinition(user.Username, permTypesNone, EntityTokenSerializer.Serialize(a));
PermissionTypeFacade.SetUserPermissionDefinition(perm);


Not sure if this is the "correct" way but it works so hopefully someone finds it useful

Viewing all articles
Browse latest Browse all 2540

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>