Check if user has certain permissions in client side Method

Hi, I created a custom Action in ItemType 'Part' that calls a client Method. Only the Part Owner shall be able to run the Action. The Owner can be one person or a user group. How can I check, if the current user is in this user group and have the necessary permissions to run the Action? I tried the following AML query, but unfortunately no Result is returned:
// check permission
var aml = "<AML><Item type = \"Part\" id=\"7FB48EA1AFAC4DA498F7AA4E531A7828\" access_type=\"can_update\" action=\"getPermissions\" ></Item></AML>";
var result = inn.applyAML(aml);
return alert(result.getResult() );
In a server side Method I can use the following code:
string ownedById = this.getProperty("owned_by_id");
if (!CCO.Permissions.IdentityListHasId(Aras.Server.Security.Permissions.Current.IdentitiesList, ownedById))
{
  return inn.newError("Not allowed.");
}
Is something similar available for client side Methods? Thanks for your help! Angela
Parents
  • Hi Angela,

    I know this is very old, but you probably know the answer to this question. Can I ask you how you came to find this method (Aras.Server.Security.Permissions.Current.IdentitiesList)? Is there documentation somewhere that lists this? Or was it something you picked from some other code?

    Thank you,

    Kamran

  • I assume this function is part of the Aras.Server.Security.Permissions class in the Aras.Server.Core.dll (?). At least in I12. I don´t know if there is an official API reference guide available. In theory you could analyse the DLL but this probably would void the terms-of-use. And the function names are not very useful anyway without proper samples.

    In this this specific case I either found it in this forum or somewhere in the OOTB Innovator code years ago. The PE application uses it. In general the PE code contains a lot of useful and less known stuff to reuse. 

    But also the forum mentioned it:  DEVELOPERS FORUM - Check Identity List for specific identity 

    In I14 the code has changed to: CCO.Permissions.IdentitiesList

Reply
  • I assume this function is part of the Aras.Server.Security.Permissions class in the Aras.Server.Core.dll (?). At least in I12. I don´t know if there is an official API reference guide available. In theory you could analyse the DLL but this probably would void the terms-of-use. And the function names are not very useful anyway without proper samples.

    In this this specific case I either found it in this forum or somewhere in the OOTB Innovator code years ago. The PE application uses it. In general the PE code contains a lot of useful and less known stuff to reuse. 

    But also the forum mentioned it:  DEVELOPERS FORUM - Check Identity List for specific identity 

    In I14 the code has changed to: CCO.Permissions.IdentitiesList

Children