Maptio / maptio

http://www.maptio.com
Other
24 stars 5 forks source link

Granular permission system #268

Closed Safiyya closed 6 years ago

Safiyya commented 6 years ago

To scope :

Safiyya commented 6 years ago

from tom@zappistore (suggested by @tomnixon )

Safiyya commented 6 years ago

I have a couple of free days this week and could start working on this. What are your thoughts ? Any suggestions from current customers?

tomnixon commented 6 years ago

Here's a first attempt at defining a fairly comprehensive permissions system which I think should be able to handle just about any use case we can think of. Perhaps it's worth @Safiyya starting by evaluating how complex this would be to implement and if necessary we can look to simplify it into more of an MVP if that makes more sense for now.

The system would have a few security levels baked in: Super-user, Manager, User.

Super-users can also create further security levels.

Team members have a setting to assign them a particular security level. I suggest keeping this simple and having just one security level per team member.

Next there would be a permission configuration page as a big grid. Down the Y axis is a list of all actions in Maptio. For example: Create initiatives, Delete initiatives, Manage team members; Manage helpers etc.

The X axis lists the security levels.

In the grid cells there are checkboxes to set whether a particular security level can carry out that function.

Some cells have drop-down boxes which specify the scope of when a particular security level can use a particular action. For xxample: Action: Delete initiative Scope: Not allowed / Anywhere / When Authority / When Helper

This drop-down might contain different items depending on what the action is. We could start by listing the main actions a user might perform and then building out the list from there.

To give Zappistore Tom his read-only mode you could create a new security level called Read-only and set any actions that allow a user to change anything on the map to 'Not allowed.'

tomnixon commented 6 years ago

Thinking about an MVP, probably the main areas where permissions are particularly needed are the ability to delete initiatives and also certain actions around managing team members like importing, deleting or inviting users. Perhaps we could build the more comprehensive system as specified above but just include a limited number of actions. Then we could have a prompt on the page to say "Do you have other needs around permissions? Email support@maptio.com" so we can then get more customer feedback from that.

Safiyya commented 6 years ago

I think this is waay too complicated and also not needed. As far as I know the only customers that I have asked for are Zappi (PatientPop dropped out) and they were only asking for 2 levels , read-only and editing (is that right?). What you are proposing is more complicated than most systems that I know (including big names like Microsoft Azure and AWS), I really don’t see the need for all of these features at this time.

Things that are not needed IMO :

As far as I’m concerned, the MVP has 2 levels of security defined at the map level. A possible stretch would be to have these levels defined at the initiative level instead of the map level.

tomnixon commented 6 years ago

Yes that's true. I was going for comprehensive first and expecting to strip it back as needed. I was also thinking about technical debt if you build permissions for limited use cases then have to expand it later.

If it helps to stick to two levels, I wouldn't strip the lower level all the way back to read-only.

How about regular users can:

I think this would probably meet Tom@zappi's need better than read-only (although I don think having a read-only view of the map would be useful as well. I can even imagine having the ability for it to be publicly accessible on the web.) We could check this with Tom before building.

Safiyya commented 6 years ago

Technical debt works the other way round actually : the more complex the feature, the more technical debt we incur. In most cases, it is more difficult to remove code and make the codebase simpler (because the added complexity makes it difficult to read/debug) than adding code on a simple codebase. Engineers have actually a lot of acronyms and phrases to describe that phenomenon :

It always helps to attach a monetary value to any added feature.... at the rate of a UK-based freelancer (£350 -£500/day) , would you pay roughly £2000 to have all of these implemented now and maybe remove them later ?

Here is a 2-part blogpost about technical debt and overengineering https://www.turbo360.co/blog/over-engineering---part-1-rqog0m

Safiyya commented 6 years ago

To summarize,

tomnixon commented 6 years ago

Sorry, I think we missed each other here! I meant strip the requirements back, not actually build it and then remove code later.

I'll send your summary above to Tom H and see if it meets his needs.

tomnixon commented 6 years ago

From Tom H: "Like it - seems a creative way to allow people to be engaged without being able to pull the whole thing apart. To be really honest at this point I'm not completely sure, but it feels right. I'm expecting to have more feedback on permissions as more people become active."

Safiyya commented 6 years ago

Management (front-end)

Safiyya commented 6 years ago

Content (front-end)

TODO

Questions

tomnixon commented 6 years ago

I've done some testing although not exhaustive yet. From what I have seen I think it's generally working as expected - well done!

Only thing I was unsure about is whether a secretary should be able to change the Authority of an initiative. At the moment they can't, but I'm thinking they probably should be able to do that. this would also mean that in effect secretaries could delete an initiative (since they could first make themselves the authority and then delete it.) I think I'm OK with this. If someone has been made a secretary then they have been entrusted with looking after that initiative in Maptio.

tomnixon commented 6 years ago

We also need to tidy up the user interface. We need some better labels/tooltips for things. Did you want to come back to this later? Also looks messy having "XX YY can edit this initiative" repeated so many times. I think it would look neater if there was a checkbox next to Role with a heading at the top saying 'Can edit?' This label could also have a tooltip saying 'Check this box to allow contributors to edit the details of this initiative.' Something like this: image

Safiyya commented 6 years ago

The labels/tooltips/copy was my first worry, so if you could come up with phrases for each cases, that would help. I will try that UI suggestion next.

tomnixon commented 6 years ago

I'm thinking we should change the tooltips to simple messages like the ones below to just tell the user they don't have permission, but also include a 'Learn more' link to a knowledge base article that explains how permissions work. Drag and drop: "You don't have permission to drag-and-drop. Learn more." Padlocks: "You don't have permission to edit this. Learn more."

tomnixon commented 6 years ago

On the team page, can you change the heading from 'Role' to 'Permission' (just so it's not confused with how we use the term Role elsewhere.)

Safiyya commented 6 years ago

All of this will deployed in staging in about 10 mins.

tomnixon commented 6 years ago

The improvements are looking good! We're getting there.

A few issues I can see:

Safiyya commented 6 years ago

The first is actually difficult as I’m using an open source bootstrap add on that :

I tried a mix of the two (basically the whole afternoon) and that’s the result so far... I’ll try some more tonight or we’ll have find a different solution.

IRT label of “can edit”, I think “Admin” is confusing, especially for the real admins. Maybe something like super , delegate, deputy ? or any from this list https://www.google.com.lb/search?q=deputy+synonym&oq=deputy+synonym&aqs=chrome..69i57j0l5.6679j1j7&sourceid=chrome&ie=UTF-8