Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make mobile app available to viewers #1892

Merged
merged 7 commits into from
Jun 13, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- Improve ical comparison when checking for imported ical updates ([1870](https://github.com/grafana/oncall/pull/1870))
- Upgrade to Python 3.11.3 by @joeyorlando ([#1849](https://github.com/grafana/oncall/pull/1849))
- Users with the Viewer basic role can now connect and use the mobile app ([#1892](https://github.com/grafana/oncall/pull/1892))

### Fixed

Expand Down
6 changes: 3 additions & 3 deletions engine/apps/api/views/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,14 +146,14 @@ class UserView(
"verify_number": [RBACPermission.Permissions.USER_SETTINGS_WRITE],
"forget_number": [RBACPermission.Permissions.USER_SETTINGS_WRITE],
"get_verification_code": [RBACPermission.Permissions.USER_SETTINGS_WRITE],
"get_backend_verification_code": [RBACPermission.Permissions.USER_SETTINGS_WRITE],
"get_backend_verification_code": [RBACPermission.Permissions.USER_SETTINGS_READ],
"get_telegram_verification_code": [RBACPermission.Permissions.USER_SETTINGS_WRITE],
"unlink_slack": [RBACPermission.Permissions.USER_SETTINGS_WRITE],
"unlink_telegram": [RBACPermission.Permissions.USER_SETTINGS_WRITE],
"unlink_backend": [RBACPermission.Permissions.USER_SETTINGS_WRITE],
"unlink_backend": [RBACPermission.Permissions.USER_SETTINGS_READ],
"make_test_call": [RBACPermission.Permissions.USER_SETTINGS_WRITE],
"export_token": [RBACPermission.Permissions.USER_SETTINGS_WRITE],
"upcoming_shifts": [RBACPermission.Permissions.USER_SETTINGS_WRITE],
"upcoming_shifts": [RBACPermission.Permissions.USER_SETTINGS_READ],
}

rbac_object_permissions = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,19 +184,14 @@ const MobileAppConnection = observer(({ userPk }: Props) => {
}

return (
<WithPermissionControlDisplay
userAction={UserActions.UserSettingsWrite}
message="You do not have permission to perform this action. Ask an admin to upgrade your permissions."
>
<div className={cx('container')}>
<Block shadowed bordered withBackground className={cx('container__box')}>
<DownloadIcons />
</Block>
<Block shadowed bordered withBackground className={cx('container__box')}>
{content}
</Block>
</div>
</WithPermissionControlDisplay>
<div className={cx('container')}>
<Block shadowed bordered withBackground className={cx('container__box')}>
<DownloadIcons />
</Block>
<Block shadowed bordered withBackground className={cx('container__box')}>
{content}
</Block>
</div>
);

function getParsedQRCodeValue() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import { Tabs, TabsContent } from 'containers/UserSettings/parts';
import { User as UserType } from 'models/user/user.types';
import { AppFeature } from 'state/features';
import { useStore } from 'state/useStore';
import { isUserActionAllowed, UserActions } from 'utils/authorization';
import { BREAKPOINT_TABS } from 'utils/consts';

import { UserSettingsTab } from './UserSettings.types';
Expand Down Expand Up @@ -53,7 +52,7 @@ const UserSettings = observer(({ id, onHide, tab = UserSettingsTab.UserInfo }: U
!isDesktopOrLaptop,
isCurrent && teamStore.currentTeam?.slack_team_identity && !storeUser.slack_user_identity,
isCurrent && store.hasFeature(AppFeature.Telegram) && !storeUser.telegram_configuration,
isCurrent && isUserActionAllowed(UserActions.UserSettingsWrite),
isCurrent,
];

return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ import { Button, Label } from '@grafana/ui';
import cn from 'classnames/bind';

import { UserSettingsTab } from 'containers/UserSettings/UserSettings.types';
import { WithPermissionControlTooltip } from 'containers/WithPermissionControl/WithPermissionControlTooltip';
import { UserActions } from 'utils/authorization';

import styles from './index.module.css';

Expand All @@ -26,11 +24,9 @@ const MobileAppConnector = (props: MobileAppConnectorProps) => {
<div className={cx('user-item')}>
<Label>Mobile App:</Label>
<div>
<WithPermissionControlTooltip userAction={UserActions.UserSettingsWrite}>
<Button size="sm" fill="text" onClick={handleClickConfirmMobileAppButton}>
Click to add a mobile app
</Button>
</WithPermissionControlTooltip>
<Button size="sm" fill="text" onClick={handleClickConfirmMobileAppButton}>
Click to add a mobile app
</Button>
</div>
</div>
);
Expand Down