Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- defmodule Billout.Authorization.Permission do
- use Ecto.Schema
- import Ecto.Changeset
- alias Billout.Authorization.Role
- schema "permissions" do
- field :name, :string
- field :action, :string
- belongs_to :role, Role
- timestamps()
- end
- @doc false
- def changeset(permission, attrs) do
- permission
- |> cast(attrs, [:name, :action, :role_id])
- |> validate_required([ :action])
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement