JMSSecurityExtraBundle icon indicating copy to clipboard operation
JMSSecurityExtraBundle copied to clipboard

SecureParam by relation

Open dewos opened this issue 11 years ago • 1 comments

Hi. Is it possible to secure an object by his related entity? Like:

/**
* @SecureParam(name="comment.post", permissions="EDIT, DELETE")
*/
public function editPostByCommentMethod(Comment $comment)
{
        // Checks $comment->getPost() on {EDIT, DELETE} perms
}

dewos avatar May 03 '13 19:05 dewos

Ok, find it. Great bundle, bad docs :)

/**
* @SecureParam(name="#comment.getPost()", permissions="EDIT, DELETE")
*/
public function editPostByCommentMethod(Comment $comment)
{

}

dewos avatar May 07 '13 09:05 dewos