Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
3 changes: 3 additions & 0 deletions config/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,9 @@
"user": "ami.users.api.serializers.UserSerializer",
"current_user": "ami.users.api.serializers.CurrentUserSerializer",
},
"PERMISSIONS": {
"user_create": ["rest_framework.permissions.IsAdminUser"],
Copy link
Member Author

@annavik annavik Aug 22, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let me know if you would do it like this @mihow? I had a look here: https://djoser.readthedocs.io/en/latest/settings.html#permissions

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for finding this setting. Admin for user_create is perfect for the demo. I will make it environment-specific next week.

},
}

# By Default swagger ui is available only to admin user(s). You can change permission classes to change that
Expand Down
2 changes: 0 additions & 2 deletions ui/src/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import { Auth } from 'pages/auth/auth'
import { Login } from 'pages/auth/login'
import { ResetPassword } from 'pages/auth/reset-password'
import { ResetPasswordConfirm } from 'pages/auth/reset-password-confirm'
import { SignUp } from 'pages/auth/sign-up'
import { CollectionDetails } from 'pages/collection-details/collection-details'
import { Deployments } from 'pages/deployments/deployments'
import { Jobs } from 'pages/jobs/jobs'
Expand Down Expand Up @@ -65,7 +64,6 @@ export const App = () => (
/>
<Route path="auth" element={<AuthContainer />}>
<Route path="login" element={<Login />} />
<Route path="sign-up" element={<SignUp />} />
<Route path="reset-password" element={<ResetPassword />} />
<Route
path="reset-password-confirm"
Expand Down
5 changes: 0 additions & 5 deletions ui/src/components/header/header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,6 @@ export const Header = () => {
</>
) : (
<>
<Button
label={translate(STRING.SIGN_UP)}
theme={ButtonTheme.Plain}
onClick={() => navigate(APP_ROUTES.SIGN_UP)}
/>
<Button
label={translate(STRING.LOGIN)}
theme={ButtonTheme.Plain}
Expand Down
9 changes: 3 additions & 6 deletions ui/src/pages/auth/login.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ export const Login = () => {
{errorMessage}
</p>
)}
</form>
<div className={styles.outro}>
<p className={styles.text}>
{translate(STRING.FORGOT_PASSWORD)}{' '}
<Link
Expand All @@ -88,12 +90,7 @@ export const Login = () => {
{translate(STRING.RESET)}
</Link>
</p>
</form>
<div className={styles.outro}>
<p className={styles.text}>
{translate(STRING.MESSAGE_NO_ACCOUNT_YET)}{' '}
<Link to={APP_ROUTES.SIGN_UP}>{translate(STRING.SIGN_UP)}</Link>
</p>
{/* TODO: Add link to join waitlist */}
<p className={classNames(styles.text, styles.divider)}>
{translate(STRING.OR).toUpperCase()}
</p>
Expand Down