Skip to content

feat: Add view access checker - #10800

Merged
caalador merged 11 commits into
masterfrom
view-access-checker
May 20, 2021
Merged

caalador merged 11 commits into
masterfrom
view-access-checker

Conversation

@Artur-

@Artur- Artur- commented Apr 26, 2021 •

Copy link
Copy Markdown
Member

Fixes #10609

@Artur- Artur- changed the title View access checker feat: Add view access checker Apr 26, 2021
@Artur-
Artur- force-pushed the view-access-checker branch 2 times, most recently from 05cbc1b to 96bd822 Compare April 30, 2021 12:34
@pleku
pleku requested a review from taefi May 3, 2021 11:51

@taefi taefi left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Some questions:

  • How the ViewAccessChecker would be enabled? (I mean not using spring add-on) Should the user add it as beforeEnterListener through VaadinServiceInitListener or ...?

  • Shouldn't some unit tests or ITs be added for these changes, especially the ViewAccessChecker class?

And the ViewAccessChecker does not comply with line wrapping length of 80 defined for flow repo.

@Artur-

Artur- commented May 18, 2021

Copy link
Copy Markdown
Member Author

How the ViewAccessChecker would be enabled? (I mean not using spring add-on) Should the user add it as beforeEnterListener through VaadinServiceInitListener or ...?

Yes, as it is used by the Spring integration in https://github.com/vaadin/spring/blob/456d653ca5743b81cdea4ce672170942296dee9a/vaadin-spring/src/main/java/com/vaadin/flow/spring/security/ViewAccessCheckerInitializer.java

@Artur-

Artur- commented May 18, 2021

Copy link
Copy Markdown
Member Author

Added unit tests, fixed formatting

@Artur-
Artur- force-pushed the view-access-checker branch from 9bf332c to 088d28c Compare May 18, 2021 07:51
@vaadin-bot vaadin-bot added +0.1.0 and removed +1.0.0 labels May 18, 2021
reorder imports based on flow repo rules
rename anon to anonymous

@caalador caalador left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Would it make sense to have an IT module with full usage including the pluging into a UI instance?

Else seems fine after the 2 minor additions/changes

@Artur-

Artur- commented May 20, 2021 •

Copy link
Copy Markdown
Member Author

Would it make sense to have an IT module with full usage including the pluging into a UI instance?

It would. Right now it is in vaadin/spring#780

@Artur-

Artur- commented May 20, 2021

Copy link
Copy Markdown
Member Author

Added "access denied" in dev mode.

@caalador
caalador requested a review from taefi May 20, 2021 09:24
caalador
caalador previously approved these changes May 20, 2021
taefi
taefi previously approved these changes May 20, 2021

@taefi taefi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Other than the comment on nullability of configuration, looks good to me.

@Artur-

Artur- commented May 20, 2021

Copy link
Copy Markdown
Member Author

Can configuration ever be null really?

@caalador

Copy link
Copy Markdown
Contributor

Only if the UI is not connected to a VaadinSession. I don't think its probable that this would ever be the case here.

@Artur-

Artur- commented May 20, 2021

Copy link
Copy Markdown
Member Author

Yeah, not in a real "before enter" event

@Artur-
Artur- dismissed stale reviews from taefi and caalador via db688f8 May 20, 2021 11:39
@caalador
caalador dismissed denis-anisimov’s stale review May 20, 2021 12:18

value not available outside.

@caalador
caalador enabled auto-merge (squash) May 20, 2021 12:22
@vaadin-bot

Copy link
Copy Markdown
Collaborator

This ticket/PR has been released with platform 21.0.0.alpha3. For prerelease versions, it will be included in its final version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support annotating Flow views with the same annotations used for endpoints

5 participants