Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
jaalah committed Jan 31, 2024
2 parents dea5d57 + 8bbaaad commit e6d974c
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 19 deletions.
5 changes: 5 additions & 0 deletions packages/manager/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/).

## [2024-01-31] - v1.110.3

### Fix:
- Enable `Can add VPCs to this account` for user permissions

## [2024-01-31] - v1.110.2

### Changed:
Expand Down
2 changes: 1 addition & 1 deletion packages/manager/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "linode-manager",
"author": "Linode",
"description": "The Linode Manager website",
"version": "1.110.2",
"version": "1.110.3",
"private": true,
"type": "module",
"bugs": {
Expand Down
27 changes: 9 additions & 18 deletions packages/manager/src/features/Users/UserPermissions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ interface State {
showTabs?: boolean;
tabs?: string[];
userType: null | string;
vpcEnabled: boolean;
}

type CombinedProps = Props &
Expand All @@ -96,12 +95,6 @@ class UserPermissions extends React.Component<CombinedProps, State> {
componentDidMount() {
this.getUserGrants();
this.getUserType();

if (this.props.flags.vpc) {
this.setState({ vpcEnabled: true });
this.entityPerms.push('vpc');
this.globalBooleanPerms.push('add_vpcs');
}
}

componentDidUpdate(prevProps: CombinedProps) {
Expand Down Expand Up @@ -172,6 +165,7 @@ class UserPermissions extends React.Component<CombinedProps, State> {
'domain',
'longview',
'database',
'vpc',
];

entitySetAllTo = (entity: GrantType, value: GrantLevel) => () => {
Expand Down Expand Up @@ -267,17 +261,18 @@ class UserPermissions extends React.Component<CombinedProps, State> {
};

globalBooleanPerms = [
'add_databases',
'add_domains',
'add_firewalls',
'add_images',
'add_linodes',
'add_nodebalancers',
'add_longview',
'longview_subscription',
'add_domains',
'add_nodebalancers',
'add_stackscripts',
'add_images',
'add_volumes',
'add_firewalls',
'add_databases',
'add_vpcs',
'cancel_account',
'longview_subscription',
];

globalPermOnChange = (perm: string) => (
Expand Down Expand Up @@ -483,15 +478,12 @@ class UserPermissions extends React.Component<CombinedProps, State> {
add_nodebalancers: 'Can add NodeBalancers to this account ($)',
add_stackscripts: 'Can create StackScripts under this account',
add_volumes: 'Can add Block Storage Volumes to this account ($)',
add_vpcs: 'Can add VPCs to this account',
cancel_account: 'Can cancel the entire account',
longview_subscription:
'Can modify this account\u{2019}s Longview subscription ($)',
};

if (this.state.vpcEnabled) {
permDescriptionMap['add_vpcs'] = 'Can add VPCs to this account';
}

if (this.state.userType === 'parent') {
permDescriptionMap['child_account_access'] =
'Enable child account access';
Expand Down Expand Up @@ -817,7 +809,6 @@ class UserPermissions extends React.Component<CombinedProps, State> {
loadingGrants: false,
setAllPerm: 'null',
userType: null,
vpcEnabled: false,
};
}

Expand Down

0 comments on commit e6d974c

Please sign in to comment.