Forum Discussion
Hi Suhas and Gopikrishnan,
Because, I have nothing in "Can Add" of the ItemType, the button do nothing when I click on it.
And will never do something, this is why I wanted to remove it.
But if this is not possible, I will forgot this idea.
Hello,
I want to do the same, Is there a way to remove that create button or disable it from UI.
My use case is I am creating items from the backend code using IOM api and want to restrict Item creation from UI.
For disabling button I can remove can add from item but in that case I can't create items using IOM api as well.
Need some way remove or disable create button from UI only.
Thanks,
Nilesh
- Gopikrishnan5 years agoIdeator I
Under can add, give access only to user account you are using to create the item in IOM api.(example: Super User).
- Nilesh5 years agoIdeator I
Thanks for reply......
In IOM api I am using admin user and want to disable create button for the same user, See I don't it is possible by making changes in can add relationship, As I need to add some user in can add to create item using IOM api, but that user can create item from UI right, I want to restrict that.
Can I do it using any client script?Thanks,
Nilesh- Gopikrishnan5 years agoIdeator I
Hi Nilesh
You can create specific identity and add in can Add. Only members of that identity can add the item in UI as well as in IOM method. In your method, you can grant the access to that identity and revoke later.
Code Snippet below
In my case, I added ARAS PLM in Can Add - Only members of ARAS PLM can add this item
Innovator inn = this.getInnovator();
// Granting Access to ARAS PLM
Aras.Server.Security.Identity plmIdentity = Aras.Server.Security.Identity.GetByName("Aras PLM");
bool PermissionWasSet = Aras.Server.Security.Permissions.GrantIdentity(plmIdentity);
try
{
var createItem = inn.newItem("Document", "add");
createItem.setProperty("name", "TestDocument");
createItem.setProperty("item_number", "1234");
createItem= createItem.apply();
}
finally
{
// Revoke 'Aras PLM' permissions
if (PermissionWasSet) Aras.Server.Security.Permissions.RevokeIdentity(plmIdentity);
}
return this;Thank You
Gopikrishnan R