• eventNode.canAddMixin always returns false for non-admin?

  • He we will discuss about how to make customization and improvement to the OpenKM source code.
He we will discuss about how to make customization and improvement to the OpenKM source code.
Forum rules: Please, before asking something see the documentation wiki or use the search feature of the forum. And remember we don't have a crystal ball or mental readers, so if you post about an issue tell us which OpenKM are you using and also the browser and operating system version. For more info read How to Report Bugs Effectively.
 #13966  by AlexBeaudoin
 
I'm trying to add the okg:prop property group automagically whenever a document is modified in the repository. This property group was manually added to the PropertyGrouups.[cnd,xml] files.

canAddMixin() seems to work fine for the okmAdmin user (false if the property group has already been added, true otherwise), but whenever a non-admin account adds a new document canAddMixin() always returns false.

However, manually calling eventNode.addMixin("okg:prop") by the non-admin account adds the mixin correctly.

Here's a snippet of the related okm:scriptCode.
Code: Select all
...
if(eventNode.canAddMixin("okg:prop"))
{
    eventNode.addMixin("okg:prop");
    print("EVENT_NODE_CAN_ADDMIXIN!!");
}
else
{
    print("EVENT_NODE_CAN_NOT_ADDMIXIN!!");
}
...
Sure, I could check that the script was called by CREATE_DOCUMENT event, but this will not catch the case when someone removed the propertygroup manually.

About Us

OpenKM is part of the management software. A management software is a program that facilitates the accomplishment of administrative tasks. OpenKM is a document management system that allows you to manage business content and workflow in a more efficient way. Document managers guarantee data protection by establishing information security for business content.