Hi Bryan,
Do you mean this - https://developer.atlassian.com/display/CONFDEV/Form+Token+Handling - ?
Andrew.
For everyone stumbling over atl_token
, which they need in order to send queries to built-in actions such as setcontentpermissions.action
.
You can get it $('[name="atl_token"]').attr('value')
on Confluence pages.
So from now on, this works:
$.get(`${location.origin}/pages/setcontentpermissions.action?viewPermissionsGroups=k15t-users&editPermissionsGroups=k15t-users&contentId=${AJS.Meta.get('draft-id')}&atl_token=${$('[name="atl_token"]').attr('value')}`)
Since AJS.safe.get()
does not work, you can use the atl_token in your own requests with whatever XMLHTTPRequest fashion you want.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Martin!
Do you have an idea how to add user restrictions instead of group-restriction with this method?
I found out that using ?viewPermissionsUsers=USER does not work. It only works with a long user key like this: viewPermissionsUsers=8a8a89a55365d4c6015365d5e9c913af
I can get the current user from a the meta-tag "ajs-remote-user-key", but I don´t know how to get this key for arbitrary users.
Thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Don't know. What do you mean by atl_token?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.