Comments (5)
Seems that the backend is trying to send back a blank role, hence the message.
from talk.
Currently as well, the roles are implemented as an array of roles rather than a single role. The FE needs to implement the ability to remove and add specific roles rather than simply "setting" the role which is what's being done now. The BE doesn't have a method for this yet, but I'd expect to see something like:
...
router.delete('/:user_id/role/:role_name', authorization.needed('admin'), (req, res, next) => {
User.removeRoleFromUser(req.params.user_id, req.params.role_name)
.then(() => {
res.status(204).end();
})
.catch((err) => {
next(err);
});
});
...
from talk.
Where to put the functionality to set a single role is an interesting question.
My instinct is to create an endpoint that clears a users roles then adds the one that is sent, effectively modeling the single role behavior.
The other option is to handle this on the front end, but asking the front end to send multiple requests to remove and add seems inefficient.
from talk.
As multiple roles can have different responsibilities (Even with overlapping responsibilities) I think that the model that we have supports this already.
I spoke with Emma regarding the UX/UI for this and I had suggested changing the role change screen to be similar to the "add a label" component for Github issues, where a dropdown shows all the possible roles, and you click to enable/disable them.
This wouldn't be multiple requests as again, a user could have multiple roles.
from talk.
I like that solution more. Moving this to a pivotal story: https://www.pivotaltracker.com/story/show/135814307
from talk.
Related Issues (20)
- Show Mod Tools in View Conversation Window HOT 1
- commentModerationActions table infos HOT 1
- proxy request /api/graphql (ECONNREFUSED) on watch HOT 2
- No moderation possible on DPG - deStentor.nl HOT 1
- Docker image for 7.4.7 missing HOT 1
- Display name HOT 1
- While trying to update story url in API getting error
- Comment Count issue HOT 2
- Recommended OpenID Connect provider? HOT 1
- WebSocket live subscriptions are not working in Firefox HOT 5
- API query for users HOT 2
- Node 14 LTS end of life HOT 1
- Unit tests seem to expect current language to be en-US HOT 2
- Can't find module HOT 2
- Upgrade to v8.0.3 is not working HOT 2
- Is it possible to choose the language in the embed script for a multilanguage site? HOT 1
- Internal Error everywhere due to inability to authenticate via Admin Token OR username / password
- Badge Refresh SSO / image badges? HOT 6
- Image Badges (flair) HOT 2
- French translation for new comments area HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from talk.