nickyhajal / world-domination-summit

Code for the World Domination Summit
http://worlddominationsummit.com
3 stars 5 forks source link

Manage a user's capabilities #32

Closed nickyhajal closed 10 years ago

nickyhajal commented 10 years ago

The flow for this should be:

  1. User goes to manifest and searches for someone who should have a capability
  2. Click on the row of the user whose capability should be added
  3. Scroll to a Select2-multi-value select box (http://ivaynberg.github.io/select2) with available capabilities
    • The Select2 library is already included and used throughout the codebase
    • The user's current capabilities should already be in the multi-select and removable
    • Capabilities the user doesn't have should be selectable
  4. Capabilities should be updated upon save

Let me know if that's all good and if you have any questions!

nickyhajal commented 10 years ago

One note -

At the moment User.hasCapability() has a map so that, for example, 'manifest' also gives the 'add-attendee' capability. We should only list the top-level, broad capabilities in the list above.

We should probably move that map within the function up to the object, User.capabilityMap, so that it can be used in other settings.

Or, maybe it should be a full map of all capabilities:

User.capabilities = {manifest: ['add-attendee', 'user'], speakers: ['add-speaker', 'speaker']}

There's some architectural flexibility there - feel free to do whatever seems best to you as you work through it.