#13 ✓resolved
davesag (at gmail)

add 'admin' user interface elements

Reported by davesag (at gmail) | September 24th, 2010 @ 05:54 PM | in v1.0

predefine 2 roles, 'superuser' and 'admin'
the root user should be BOTH 'superuser' and 'admin'

a superuser can edit anything
and admin user can appoint users an 'admin' role, and edit / delete users without a role.

users without a role can delete themselves and edit themselves (done now)

so add routes for
get '/users'

           if you are an admin it lists all users with no role.
           if there are no such users it displays an option to add a new user
           if you are a superuser then list all the admin users too and add a widget to make people admins or not.
           else bounce

get '/user/new'

           if you are an admin or superuser you can create users.
           if you are a superuser you can set the user's role (admin or not)
           action ==> post '/user'

post '/user'

           users will receive an email to activate themselves and to choose their password.
            (displays /user/:id)

get /user/:id

           display what we know, according to your role.
           if you are an admin you can edit a user.
             users will receive an email if their email address is updated.
           if you are a superuser you can set the user's role (admin or not)

get '/user/edit/:id

           an admin can edit a user.  a superuser can edit an admin.

put /user:id

           params[:email, :password, html_pref, roles, locale]  (roles if you are a superuser)

Comments and changes to this ticket

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

Frank is intended to be a very simple but feature complete web-app built on top of Sinatra that provides simple user login, password reminder, and user email verification with support for simple roles. It is intended to be used by other developers as both a well documented example of Sinatra in use, and a starting point for others wishing to implement simple web apps very quickly.

Shared Ticket Bins

People watching this ticket