Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit0000250

Browse files
committed
[symfony#3258] A bunch of fixes thanks to@wouterj
1 parentbc22f16 commit0000250

File tree

3 files changed

+14
-14
lines changed

3 files changed

+14
-14
lines changed

‎book/security.rst

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -994,7 +994,7 @@ key:
994994
),
995995
996996
In this case, when the user tries to access any URL starting with ``/_internal/secure``,
997-
she will only be granted access if the IP address is ``127.0.0.1`` or if
997+
they will only be granted access if the IP address is ``127.0.0.1`` or if
998998
the user has the ``ROLE_ADMIN`` role.
999999

10001000
Inside the expression, you have access to a number of different variables
@@ -1966,10 +1966,12 @@ accepts an :class:`Symfony\\Component\\ExpressionLanguage\\Expression` object::
19661966
}
19671967

19681968
In this example, if the current user has ``ROLE_ADMIN`` or if the current
1969-
user object's ``isSuperAdmin`` method returns ``true``, then access will
1969+
user object's ``isSuperAdmin()`` method returns ``true``, then access will
19701970
be granted (note: your User object may not have an ``isSuperAdmin`` method,
1971-
that method is invented for this example). This uses an expression and you
1972-
can learn more about the expression language syntax, see:doc:`/components/expression_language/syntax`.
1971+
that method is invented for this example).
1972+
1973+
This uses an expression and you can learn more about the expression language
1974+
syntax, see:doc:`/components/expression_language/syntax`.
19731975

19741976
.. _book-security-expression-variables:
19751977

@@ -1985,11 +1987,9 @@ Inside the expression, you have access to a number of variables:
19851987
* ``trust_resolver``: The:class:`Symfony\\Component\\Security\\Core\\Authentication\\AuthenticationTrustResolverInterface`,
19861988
object: you'll probably use the ``is_*`` functions below instead.
19871989

1988-
Additionally, you have access to a number of functions inside the expression.
1989-
**Note**: some of these functions *look* similar to the ``IS_AUTHENTICATED_*``
1990-
attributes, but work differently. See the note below:
1990+
Additionally, you have access to a number of functions inside the expression:
19911991

1992-
* ``is_authenticated``: Returns true if the user is authenticated via "remember-me"
1992+
* ``is_authenticated``: Returns``true`` if the user is authenticated via "remember-me"
19931993
or authenticated "fully" - i.e. returns true if the user is "logged in";
19941994
* ``is_anonymous``: Equal to using ``IS_AUTHENTICATED_ANONYMOUSLY`` with
19951995
the ``isGranted`` function;

‎reference/constraints/Expression.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ One way to accomplish this is with the Expression constraint:
6969
constraints:
7070
-Expression:
7171
expression:"this.getCategory() in ['php', 'symfony'] or !this.isTechnicalPost()"
72-
message:"If this is a tech post, the category should be php or symfony!"
72+
message:"If this is a tech post, the category should beeitherphp or symfony!"
7373
7474
..code-block::php-annotations
7575
@@ -80,8 +80,8 @@ One way to accomplish this is with the Expression constraint:
8080
8181
/**
8282
* @Assert\Expression(
83-
* "this.getCategory() in ['php', 'symfony'] or !this.isTechnicalPost()",
84-
* message="If this is a tech post, the category should be php or symfony!"
83+
*"this.getCategory() in ['php', 'symfony'] or !this.isTechnicalPost()",
84+
*message="If this is a tech post, the category should be either php or symfony!"
8585
* )
8686
*/
8787
class BlogPost
@@ -98,7 +98,7 @@ One way to accomplish this is with the Expression constraint:
9898
this.getCategory() in ['php', 'symfony'] or !this.isTechnicalPost()
9999
</option>
100100
<optionname="message">
101-
If this is a tech post, the category should be php or symfony!
101+
If this is a tech post, the category should beeitherphp or symfony!
102102
</option>
103103
</constraint>
104104
</class>
@@ -118,7 +118,7 @@ One way to accomplish this is with the Expression constraint:
118118
{
119119
$metadata->addConstraint(new Assert\Expression(array(
120120
'expression' => 'this.getCategory() in ["php", "symfony"] or !this.isTechnicalPost()',
121-
'message' => 'If this is a tech post, the category should be php or symfony!',
121+
'message' => 'If this is a tech post, the category should beeitherphp or symfony!',
122122
)));
123123
}
124124

‎reference/twig_reference.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ Functions
9292
+----------------------------------------------------+--------------------------------------------------------------------------------------------+
9393
| ``url(name, parameters = {})``| Equal to ``path(...)`` but it generates an absolute URL|
9494
+----------------------------------------------------+--------------------------------------------------------------------------------------------+
95-
| ``expression(expression)``| Creates an :class:Symfony\\Component\\ExpressionLanguage\\Expression in Twig. See|
95+
| ``expression(expression)``| Creates an:class:`Symfony\\Component\\ExpressionLanguage\\Expression` in Twig. See|
9696
|| ":ref:`Template Expressions<book-security-template-expression>`".|
9797
+----------------------------------------------------+--------------------------------------------------------------------------------------------+
9898

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp