|
To confirm, checking if the current code is being executed by a live-template macro, check if the following value is not null:
HttpServletRequest.getAttribute( "net.customware.confluence.scaffold.live-template" ) It will be a Stack of words which are either "space" or "global" depending on the type of template being executed. Generally, security macros will only be interested in the top entry. I guess I don't have authority to close this item - so here is an update. Things seem to be working fine
Given that User Macros are only editable by administrators, I'd like very much to see the restrictions relaxed for calls within User Macros as well.
I think that would have to be something that Bob would implement...
Agree. I would like it as well. I have thought about this, but so far have not come up with a good solution. David was able to add the enabler to scaffold (this issue), but we don't really have control over user macro running unless Atlassian gets involved. Please create an issue for Macro security
|
||||||||||||||||||||||||||||||||||||||||||||
(8:55:16 PM) David Peterson: "net.customware.confluence.scaffolding.live-template" will be either null or a Stack containing a string, either "space" or "global".
(8:55:22 PM) David Peterson: Yes.
(8:56:00 PM) David Peterson: Containing one or more strings, rather.
(8:56:20 PM) David Peterson: The top item on the stack will be the most recent template type to be executed.
(8:56:36 PM) Bob@home: ok, get the stack and check if not null, then check (perhaps) that they are all global if only global are allowed
(8:56:57 PM) David Peterson: Right
(8:57:08 PM) David Peterson: Although you may only want to check that the top-level one is global.
(8:57:12 PM) David Peterson: Depends on your paranoia.
(8:57:18 PM) Bob@home: hmm... in fact would just have to check the last one on stack
(8:57:21 PM) David Peterson: Yes
(8:57:24 PM) Bob@home: ok, agree
(8:57:30 PM) David Peterson: The only reason it's a stack is for technical reasons
(8:58:22 PM) Bob@home: I think that would work fine.