Skip to content

Latest commit

 

History

History
85 lines (57 loc) · 2.58 KB

TODO.pod

File metadata and controls

85 lines (57 loc) · 2.58 KB

TODO for Dancer::Plugin::SimpleCRUD

Tidy up and refactor where possible.

It's a bit of a mess at the moment.

Authentication with Dancer::Plugin::Auth::Extensible

Make it easy to require authentication via DPAE. There should probably be the option to set two sets of requirements - viewing and editing - for instance, "must be logged in to view, but must have Admin role to edit" sounds like a fairly common requirement.

Configuration

Probably something like:

auth => {
    view => {
        require_login => 1,
    },
    edit => {
        require_role => 'Admin',
    },
},

Or, to just require login for anything (same requirements for both viewing and editing), shorthand:

auth => {
    require_login => 1,
},

So, key is the DPAE keyword to call to wrap the routes defined.

Where it gets trickier is deciding if the user should see add/edit/delete links, rather than just enforcing whether they can do it.

If auth => edit is set, we'd need to do the appropriate thing (check they're logged in if require_login is used, check they are logged in as a user with the right role if require_role etc is used), and then override editable/deleteable as appropriate.

Implementation

Implementation should be reasonably easy - take the route handler being set up, and pass it to require_login etc. DPAE will need to be imported if (and only if) the auth options have been set, in order to have its keywords available to us.

Option to make the list page handler return template-ready params

Provide option to make list page handler return template-ready params instead of plain HTML, for those who want to customise the page a lot more.

Support more databases

Refactor _find_columns() to work in a DB-agnostic way, and support other databases - PostgreSQL? SQLite? DBIC?

Show message when an entry has been created/edited/deleted

At the moment we just send the user back to the list page, we should probably show a "Record {added,updated,deleted}" message to make it clear it was successful.

Option to present form in facebox div?

Maybe add the option for the add/edit form to be presented within a "popup div" using Facebox, rather than as a standalone page. (When the form is submitted, it could need to reload the list page afterwards, or we could allow that to be done via an AJAX call too)

Automatic password confirmation

If we recognise a field as a password field, present a "Type your password again" box, and add code to validate that the passwords match.