Advertisement
Guest User

Untitled

a guest
Feb 23rd, 2019
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. {% if currentUser.isInGroup('groupHandle') %}
  2.  
  3. {{ currentUser.getGroups() }}
  4.  
  5. {{ currentUser.can('permissionName') }}
  6.  
  7. //get the current user from craft
  8. $user = Craft::$app->getUser();
  9.  
  10. //check if the current user has permission to edit certain entries
  11. $user->getIdentity()->can('editEntries: 27')
  12.  
  13. //check if user is in group
  14. $user->getIdentity()->isInGroup('specialGroupHandle'));
  15.  
  16. //get the current user from craft
  17. $user = craft()->userSession->getUser();
  18.  
  19. //check if the current user has permission to edit certain entries
  20. $checkPerms = $user->can('editEntries: 27');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement