This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
editor: | |
- add_content | |
moderator: | |
- moderate_content | |
admin: | |
- edit_user |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
catch_all: | |
path: /{route} | |
requirements: | |
route: .* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% if is_granted(‘ROLE_ADMIN’) %} | |
<button>Secret Button</button> | |
{% endif %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% if is_granted(‘add_content’) %} | |
<button>Add content</button> | |
{% endif %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//... | |
class PermissionVoter implements VoterInterface | |
{ | |
//... | |
/** | |
* {@inheritdoc} | |
*/ | |
public function vote(TokenInterface $token, $object, array $attributes) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//... | |
class PermissionFacade | |
{ | |
/** | |
* Global static helper for using isGranted from legacy codebase. | |
* @param $attributes | |
* @param null $object | |
* @return bool|void | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//... | |
if (PermissionFacade::isGranted(‘add_content’)) { | |
echo ‘<button>Add content</button>’; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
status=$(curl -L -s -o /dev/null -w "%{http_code}" "http://url/to/check"); | |
if [ "200" == "${status}" ]; then say -v "Good News" "ALL DONE YO!"; elif [ "502" == "${status}" ]; then say -v Whisper "Still Fucked"; else say -v "Bad News" "Not yet"; fi; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#mcvities_snuggletWrapper { | |
position:fixed; | |
bottom:0; | |
width:100%; | |
height:1px; | |
pointer-events:none; | |
z-index: 2147483640; | |
} | |
#mcvities_snuggletWrapper.down { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if(window.SNUGGLE) { SNUGGLE.snug(); } | |
window.SNUGGLE || (function(window){ | |
window.SNUGGLE = { | |
snug: function(){ | |
var viewportWidth = document.documentElement.clientWidth, | |
viewportHeight = document.documentElement.clientHeight; | |
var body = document.getElementsByTagName('body'); |