-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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/brain access rights #705
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
LOGAF Level 3 - /home/runner/work/quivr/quivr/backend/core/routes/authorizations/brain_authorization.py The code is generally good, but there are areas for potential improvement.
LOGAF Level 3 - /home/runner/work/quivr/quivr/backend/core/routes/subscription_routes.py The code is generally good, but there are areas for potential improvement.
LOGAF Level 5 - /home/runner/work/quivr/quivr/frontend/lib/components/NavBar/components/NavItems/components/BrainsDropDown/components/BrainActions/BrainActions.tsx The code is excellent and needs no changes. LOGAF Level 5 - /home/runner/work/quivr/quivr/frontend/lib/components/NavBar/components/NavItems/components/BrainsDropDown/components/BrainActions/components/ShareBrain/ShareBrain.tsx The code is excellent and needs no changes. LOGAF Level 5 - /home/runner/work/quivr/quivr/frontend/lib/components/NavBar/components/NavItems/components/BrainsDropDown/components/BrainActions/components/ShareBrain/tests/ShareBrain.test.tsx The code is excellent and needs no changes. LOGAF Level 5 - /home/runner/work/quivr/quivr/frontend/lib/components/NavBar/components/NavItems/components/BrainsDropDown/components/BrainActions/components/ShareBrain/components/BrainUsers/hooks/useBrainUsers.ts The code is excellent and needs no changes. LOGAF Level 5 - /home/runner/work/quivr/quivr/frontend/lib/components/NavBar/components/NavItems/components/BrainsDropDown/components/BrainActions/components/ShareBrain/components/index.ts The code is excellent and needs no changes. LOGAF Level 5 - /home/runner/work/quivr/quivr/frontend/lib/components/NavBar/components/NavItems/components/BrainsDropDown/components/BrainActions/components/ShareBrain/hooks/useShareBrain.ts The code is excellent and needs no changes./home/runner/work/quivr/quivr/frontend/lib/components/ui/Select.tsx - LOGAF Level 3 This code is generally good, but there are a few areas for potential improvement:
Here's an example of how you might address these issues: const renderLabel = (label: string | undefined) => {
return label !== undefined && (
<label
className="block text-sm font-medium leading-6 text-gray-900 mb-2"
>
{label}
</label>
);
};
// ...
return (
<div>
{renderLabel(label)}
<div className="relative">
<Popover
Trigger={
<button
type="button"
className="relative w-full cursor-default rounded-md bg-white py-1.5 pl-3 pr-10 text-left text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 focus:outline-none focus:ring-2 focus:ring-indigo-500 sm:text-sm sm:leading-6"
aria-haspopup={isOpen ? "true" : "false"}
>
{/* ... */}
</button>
}
// ...
>
<ul role="listbox">
{options.map((option, index) => (
<li
className="text-gray-900 relative cursor-pointer select-none py-2"
id={`listbox-option-${index}`}
key={option.value}
onClick={() => onChange(option.value)}
>
{/* ... */}
</li>
))}
</ul>
</Popover>
</div>
</div>
); In this example, 👍🔧📚 Powered by Code Review GPT |
e059ffd
to
2737707
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Love it ! Congratts
@@ -7,16 +8,27 @@ | |||
from models.users import User | |||
|
|||
|
|||
def has_brain_authorization(required_role: Optional[str] = "Owner"): | |||
class RoleEnum(str, Enum): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Me gustaaa !
* refactor(BrainUsers) * feat: give brain share access to EDITORs * feat(RBAC): add role enum and supports multiple roles check * feat: make owner right read only for other permissions
Description