Add customizable user roles (#18641)
* Add customizable user roles * Various fixes and improvements * Add migration for old settings and fix tootctl role management
This commit is contained in:
		
							parent
							
								
									1b4054256f
								
							
						
					
					
						commit
						44b2ee3485
					
				
					 187 changed files with 1945 additions and 1032 deletions
				
			
		| 
						 | 
				
			
			@ -5,8 +5,9 @@ import IconButton from '../../../components/icon_button';
 | 
			
		|||
import ImmutablePropTypes from 'react-immutable-proptypes';
 | 
			
		||||
import DropdownMenuContainer from '../../../containers/dropdown_menu_container';
 | 
			
		||||
import { defineMessages, injectIntl } from 'react-intl';
 | 
			
		||||
import { me, isStaff } from '../../../initial_state';
 | 
			
		||||
import { me } from '../../../initial_state';
 | 
			
		||||
import classNames from 'classnames';
 | 
			
		||||
import { PERMISSION_MANAGE_USERS } from 'mastodon/permissions';
 | 
			
		||||
 | 
			
		||||
const messages = defineMessages({
 | 
			
		||||
  delete: { id: 'status.delete', defaultMessage: 'Delete' },
 | 
			
		||||
| 
						 | 
				
			
			@ -50,6 +51,7 @@ class ActionBar extends React.PureComponent {
 | 
			
		|||
 | 
			
		||||
  static contextTypes = {
 | 
			
		||||
    router: PropTypes.object,
 | 
			
		||||
    identity: PropTypes.object,
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  static propTypes = {
 | 
			
		||||
| 
						 | 
				
			
			@ -248,7 +250,7 @@ class ActionBar extends React.PureComponent {
 | 
			
		|||
        }
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
      if (isStaff) {
 | 
			
		||||
      if ((this.context.identity.permissions & PERMISSION_MANAGE_USERS) === PERMISSION_MANAGE_USERS) {
 | 
			
		||||
        menu.push(null);
 | 
			
		||||
        menu.push({ text: intl.formatMessage(messages.admin_account, { name: status.getIn(['account', 'username']) }), href: `/admin/accounts/${status.getIn(['account', 'id'])}` });
 | 
			
		||||
        menu.push({ text: intl.formatMessage(messages.admin_status), href: `/admin/accounts/${status.getIn(['account', 'id'])}/statuses?id=${status.get('id')}` });
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Reference in a new issue