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

feat: walking skeleton of private projects #4753

Merged
merged 5 commits into from
Sep 15, 2023
Merged

Conversation

sjaanus
Copy link
Contributor

@sjaanus sjaanus commented Sep 15, 2023

  1. For now it is turned off, because it has just basic components to make parts of permission logic to work
  2. It has power to restrict access to project X based on path
  3. Has power to filter out features that user does does not have access to

Next steps. Add tests and more capabilities

@vercel
Copy link

vercel bot commented Sep 15, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
unleash-monorepo-frontend ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 15, 2023 0:41am
1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
unleash-docs ⬜️ Ignored (Inspect) Visit Preview Sep 15, 2023 0:41am

src/lib/app.ts Outdated Show resolved Hide resolved
src/lib/db/index.ts Outdated Show resolved Hide resolved
import { IProjectPermissionStore } from './projectPermissionStoreType';
import { IProjectPermissionChecker } from './projectPermissionCheckerType';

export class ProjectPermissionChecker implements IProjectPermissionChecker {
Copy link
Contributor

Choose a reason for hiding this comment

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

if we don't have any more code we can use the store directly. You can call the store as read model.

return found || defaultValue;
}

/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
Copy link
Contributor

Choose a reason for hiding this comment

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

why disabling types?

req.checkProjectPermissions = async () => {
const { user } = req;

let projectId =
Copy link
Contributor

Choose a reason for hiding this comment

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

const

flagResolver,
}: Pick<IUnleashConfig, 'getLogger' | 'flagResolver'>,
{ projectService, accessService }: IUnleashServices,
): any => {
Copy link
Contributor

Choose a reason for hiding this comment

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

I wouldn't use any. There's a type for async middleware

@sjaanus sjaanus merged commit 15baea1 into main Sep 15, 2023
14 checks passed
@sjaanus sjaanus deleted the project-permissions branch September 15, 2023 12:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

2 participants