Browse files

Won't implement.

This is impossible in some cases, hard in others,
and maybe be undesirably magical anyway.

For instance, if someone wanted to do
`link_to(@post)`, we could *maybe* determined the
controller action and method and figure out if
that's authorized or not. But if they do
`link_to ('Search', '')`,
there is truly no way for Authority to authorize
that. So `authorized_link_to` would not be usable
in that case, and it's unclear what it should do.

Finally, if the developer does the normal
`link_to(@post) if current_user.can_read?(@post)`,
it's clear to him/her how Authority will answer
that question. But with `authorized_link_to`,
there would be a layer of magic in determining
which permission to check, which would make this
harder to understand and debug.

So: not gonna do it.
  • Loading branch information...
1 parent d56d78d commit a2b69de30c7bad160d92427fb1360daf92ed3d56 Nathan Long committed May 12, 2012
Showing with 0 additions and 1 deletion.
  1. +0 −1 TODO.markdown
1 TODO.markdown
@@ -9,4 +9,3 @@
## Features
-- It would be nice to have an `authorized_link_to` method, which determines from the given path and the user's permissions whether to show the link. Not sure yet how hard this would be.

0 comments on commit a2b69de

Please sign in to comment.