nerdexam
Broadcom-VMware

2V0-72.22PSE · Question #58

@EnableGlobalMethodSecurity is annotation used in Spring Security to secure which layer?

The correct answer is C. Service layer. @EnableGlobalMethodSecurity secures the service layer because it enables method-level security annotations (@PreAuthorize, @PostAuthorize, @Secured) that are applied directly to service beans - enforcing authorization at the business logic level regardless of how that logic is…

Security

Question

@EnableGlobalMethodSecurity is annotation used in Spring Security to secure which layer?

Options

  • AWeb layer
  • BController layer
  • CService layer
  • DDAO layer

How the community answered

(51 responses)
  • A
    2% (1)
  • B
    2% (1)
  • C
    88% (45)
  • D
    8% (4)

Explanation

@EnableGlobalMethodSecurity secures the service layer because it enables method-level security annotations (@PreAuthorize, @PostAuthorize, @Secured) that are applied directly to service beans - enforcing authorization at the business logic level regardless of how that logic is invoked. Options A and B (Web and Controller layers) are wrong because those layers are secured by Spring Security's HTTP security configuration (e.g., HttpSecurity, antMatchers), not method-level annotations. Option D (DAO layer) is incorrect because security concerns belong above the data access layer; applying security at the DAO level would be too late and would bypass business rule enforcement. Memory tip: Think "Global Method = business Methods in your Service" - the annotation's name literally says "method security," and services are where your business methods live.

Topics

#method-level security#@EnableGlobalMethodSecurity#service layer authorization#Spring Security

Community Discussion

No community discussion yet for this question.

Full 2V0-72.22PSE Practice