Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feature: gate audit log by permissions#3464

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
Kira-Pilot merged 5 commits intomainfromaudit-log-permissions/kira-pilot
Aug 11, 2022

Conversation

Kira-Pilot
Copy link
Member

resolves#3460

Only admin and auditor roles should have access to the new audit log. This PR gates both the link in the nav bar as well as the route itself in case someone navigates directly.

@Kira-PilotKira-Pilot requested a review froma team as acode ownerAugust 10, 2022 20:19
export const AppRouter: FC = () => {
const xServices = useContext(XServiceContext)
const [authState] = useActor(xServices.authXService)
const { permissions } = authState.context
Copy link
Contributor

@presleyppresleypAug 10, 2022
edited
Loading

Choose a reason for hiding this comment

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

This is probably a good place to useuseSelector instead ofuseActor so that we don't get re-renders for anything except permissions. In fact, I think my plan was to do that within a wrapper component so that it only gets accessed on pages that need it - seeRequireLicense herehttps://github.com/coder/coder/pull/3008/files#diff-8b4f166561cf1e9c08183827ef490e7741d6e79022122df7d835292bc3b3d0e7

Kira-Pilot reacted with thumbs up emoji
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm realizing now that I was thinking about licensing instead of role-based permissions, but maybe it's still a good idea? Up to you!

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

That is a good idea! I will play around with the wrapper component when I get to licensing, and make sure permissions go in there, too, if possible.

Copy link
Member

@EmyrkEmyrk left a comment

Choose a reason for hiding this comment

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

The perm stuff looks good 👍. I'll flush out the perms for audit_log when the feature gets in.

Kira-Pilot reacted with heart emoji
Copy link
Contributor

@presleyppresleyp left a comment

Choose a reason for hiding this comment

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

With the switch fromuseActor touseSelector, should be good!

Kira-Pilot reacted with hooray emoji
@Kira-PilotKira-Pilot merged commit6122df6 intomainAug 11, 2022
@Kira-PilotKira-Pilot deleted the audit-log-permissions/kira-pilot branchAugust 11, 2022 13:34
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@EmyrkEmyrkEmyrk left review comments

@presleyppresleyppresleyp approved these changes

@coadlercoadlerAwaiting requested review from coadler

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

Gate audit log by permissions
3 participants
@Kira-Pilot@presleyp@Emyrk

[8]ページ先頭

©2009-2025 Movatter.jp