Hi,
I have the following C# code, which is called from an Action(Item Action for Itemtype1) to create an Item(PRC is my Itemtype) and also to edit the created Item.
In the Itemtype I added 'Can Add' as 'Administrators' and in the Permissions:
![]()
Only Administrator Can Update. If I logged in as an Administrator the code is Adding/Updating item. But if I logged in as an User the code is not working.
I think this is because of the permissions given, because I can see the error messages complaining about permissions.
C#:
Innovator inn = this.getInnovator();
string prc_id = this.getProperty("prc_id"); //-- ItemType1's properties
if(prc_is==null || prc_id == "")
{
Item newPRC = inn.newItem("PRC","add");
newPRC.setProperty("Chk_id",this.getID());
newPRC.setProperty("file_prc",this.getProperty("file_",""));
newPRC = newPRC.apply();
this.setProperty("prc_id",newPRC.getID());
}
else
{
Item editPRC = inn.getItemById("PRC", prc_id);
editPRC.setAction("edit");
editPRC.setProperty("file_prc",this.getProperty("file_",""));
editPRC = editPRC.apply();
}
return this;
How to handle the permissions in the code?
I don't want any user to add the item from selecting 'new' / edit the item. Items should be added/edited only from code.
Thank you,
ErgR