# Introducing \*Shield\* -- Comprehensive security for Lucky framework

**URL:** https://forum.crystal-lang.org/t/introducing-shield-comprehensive-security-for-lucky-framework/2442
**Category:** Community
**Created:** [August 15, 2020, 4:06pm UTC](https://forum.crystal-lang.org/t/introducing-shield-comprehensive-security-for-lucky-framework/2442 "2020-08-15T16:06:32Z")
**Posts on this page:** 1
**Page:** 2

<div class="post-metadata">

### Author: ![akadusei](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.crystal-lang.org/akadusei/32/467_2.png) [@akadusei](https://forum.crystal-lang.org/u/akadusei)
#### Post date: [September 22, 2020, 8:12pm UTC](https://forum.crystal-lang.org/t/introducing-shield-comprehensive-security-for-lucky-framework/2442/21 "2020-09-22T20:12:53Z")

</div>

cc @konung

I’ve taken a cursory look at _LuckyCan_, and it should be possible, even easy, to integrate with _Shield_.

Define your policies as usual with _LuckyCan_, and in any action, you can do:

```crystal
def authorize? : Bool
  #current_user!.level.admin? || post.user_id == current_user!.id

  # Call the relevant authorization engine's helper here
  # This is for *LuckyCan*, but could be *Praetorian* or similar
  PostPolicy.create?(post, current_user!)
end

```

I should probably add this to the documentation.

[Previous page](https://forum.crystal-lang.org/t/introducing-shield-comprehensive-security-for-lucky-framework/2442.md?page=1)
