Skip to content

Commit

Permalink
Added Vue Directives to the packages
Browse files Browse the repository at this point in the history
  • Loading branch information
tim committed Dec 14, 2023
1 parent 0069611 commit 517df1e
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions resources/js/Directives/permissionDirective.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import usePermissions from "../Uses/usePermissions.js";

export function hasPermissionDirective(el, binding) {
const { can } = usePermissions()
el.hidden = can(binding.value) === false
}

export function hasRoleDirective(el, binding) {
const { is } = usePermissions()
el.hidden = is(binding.value) === false
}

0 comments on commit 517df1e

Please sign in to comment.