Phil - Tuesday, August 10, 2010 3:02 PM:
So, as I was going through my handy-dandy 9.1 programming guide, I found a recipe for setting a private permission using the Item.setPrivatePermission method.
Much to my dismay, when trying to implement the aforementioned method, I was greeted with a lovely "Object does not support this method", and sure enough, when going through the debugger, this method was definitely not on the list of supported methods.
Does this method exist at all? Or is it simply in another form? I know I can write an AML query to replace the Item's Permission Relationship, but that seems like a lot of work if something already exists.
RobMcAveney - Tuesday, August 10, 2010 4:19 PM:
That method was deprecated a while back (before 9.0 I think). It wasn't really any easier to use than straight AML, so it was pretty much redundant. I see that the Programmer's Guide was never updated to reflect that change. I will file an issue to get that fixed.
Phil - Wednesday, August 11, 2010 7:19 PM:
So, I thought I would utilize a server (onBeforeUpdate) method in order to change the permission on the item. Below is my code:
if(this.getProperty("status") == "Archived") //set the archive permission
{
this.setProperty("permission_id","D5474B02B21A4923964DAB0ACC433C6C");
}
else //set the standard permission
{
this.setProperty("permission_id","CC9C078F9B4E4EB397F63F56F88D9092");
}
return this;
I thought this simple code would work to change the permission on the Item, but it doesn't. The permission stays the same. Could default permissions be screwing with me somehow?