Java enterprise capstone
Check ownership before lookup
A principal may access only the matching resource owner; real principal verification is separate.
Formal Syntax & Structure
java syntaxjava
allowed(principal,owner)Working Example
Example Snippetjava
public class Main { static boolean allowed(String principal,String owner){return principal!=null && principal.equals(owner);} public static void main(String[] args) throws Exception { System.out.println(allowed("alpha","alpha")); System.out.println(allowed("beta","alpha")); }}