cancel
Showing results for 
Search instead for 
Did you mean: 

Split in script [resolved]

thomasberment
Champ in-the-making
Champ in-the-making
Hi, I would like to know how I can do to call the function "split" in my script to be able to retrieve the permissions function getPermissions(). It returns a list as "ALLOWED;kevinr;Consumer".

I tried the function "split" but it does not work, because it is not known in Alfresco …

Can you help me ?
4 REPLIES 4

mikeh
Star Contributor
Star Contributor
Are you saying this doesn't work?
"ALLOWED;kevinr;Consumer".split(";")‍

Mike

kbonnet
Champ in-the-making
Champ in-the-making
Ive seen split working. What's your code?

thomasberment
Champ in-the-making
Champ in-the-making
It's working now, I have changed my code.

 var perm = new String(document.getPermissions());var elements = perm.split(";");‍‍

I think we should specify that the return of getPermission is a String.

Thx you !

invictus9
Champ in-the-making
Champ in-the-making
The difficulty you are running into is that Java strings are not Javascript strings. In your solution, you are creating a Javascript string from the Java string. You will find this issue pervades the Alfresco implementation of Javascript.