permissions .write rules
---------------------- ------------
create, update, delete CUD true (not using `data` and `newData`)
none xxx false (not using `data` and `newData`)
create only Cxx "!data.exists() && newData.exists()"
update only xUx "data.exists() && newData.exists()"
delete only xxD "data.exists() && !newData.exists()"
create, delete CxD "!data.exists() || !newData.exists()"
update, delete xUD "data.exists()"
This file contains hidden or 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
<%= form_for @changeset, @action, fn f -> %> | |
<%= if @changeset.action do %> | |
<div class="alert alert-danger"> | |
<p>Oops, something went wrong! Please check the errors below.</p> | |
</div> | |
<% end %> | |
<!-- "She says ... a bunch of stuff. Look, have you tried drugs?" --> | |
<% end %> |
This file contains hidden or 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
defmodule PuffinWeb.UserController do | |
use PuffinWeb, :controller | |
alias Puffin.Accounts | |
alias Puffin.Accounts.User | |
def new(conn, _params) do | |
changeset = Accounts.change_user(%User{}) | |
render(conn, "new.html", changeset: changeset) | |
end |
This file contains hidden or 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
defmodule Puffin.Accounts do | |
@moduledoc """ | |
The Accounts context. | |
""" | |
import Ecto.Query, warn: false | |
alias Puffin.Repo | |
alias Puffin.Accounts.User |
This file contains hidden or 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
defmodule Puffin.Accounts.User do | |
use Ecto.Schema | |
import Ecto.Changeset | |
schema "users" do | |
field :name, :string | |
field :username, :string | |
timestamps() |
This file contains hidden or 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
#!/bin/sh | |
PROJECT_NAME=$1 | |
mix phx.new $PROJECT_NAME | |
cd $PROJECT_NAME | |
mix phx.gen.html Accounts User users name:string username:string:unique | |
sed -i '/ get/i \ resources "/users", UserController' lib/${PROJECT_NAME}_web/router.ex | |
mix ecto.create | |
mix ecto.migrate |
This file contains hidden or 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
function catObjects(array) { | |
if (array.length === 0) { | |
return {} | |
} | |
const obj = array.pop(); | |
return Object.assign(obj, catObjects(array)); | |
} | |
/* `refString` is basically a db path along the lines of | |
"users/(uid)/(auto-id)". This function is needed to make |
10.5 (Goodwill's New Vision in Virginia mentions a service very similar to TR, but it omits any information on how to access it or how to sign up for that matter.)
There are also 7 active services that have non-TR-based phone access to their content to access the broadcast currently on the air.
4 TR programs and 17 radio reader services went down. Included the radio reader services as well, because most of these programs started out as one and both types face the same challenges.