RFC: Make a nicer interface for Authorize
Current interface is <Authorize operation='GET' object={{path: '/teams'}}>
which requires devs to know what endpoint of the API (the path
bit) with what HTTP verb they want to authorise.
A proposed improvement is that devs would need to know the name of the action they want to authorise, e.g.
import { getUsers } from 'actions'
<Authorize action={getUsers}>
<LinkContainer to='/manage/users'>
<NavItem>Users</NavItem>
</LinkContainer>
</Authorize>
And then Authorize
(which lives in core pubsweet-client
land) has a mapping betweeen the getUsers
action and 'GET
', { path: '/users' }
.