@Test void createSecurityContextSidAnonymous() { SecurityContextHolder.getContext().setAuthentication(null); assertEquals(new GrantedAuthoritySid("ROLE_ANONYMOUS"), createSecurityContextSid()); }
public static Sid createSecurityContextSid() { Sid sid; if (SecurityUtils.currentUserIsSystem()) { sid = createSystemSid(); } else if (SecurityUtils.currentUserIsAnonymous()) { sid = createAnonymousSid(); } else { String username = SecurityUtils.getCurrentUsername(); if (username == null) { throw new NullPointerException("SecurityUtils.getCurrentUsername is null"); } sid = new PrincipalSid(username); } return sid; }
SidUtils { public static Sid createSecurityContextSid() { Sid sid; if (SecurityUtils.currentUserIsSystem()) { sid = createSystemSid(); } else if (SecurityUtils.currentUserIsAnonymous()) { sid = createAnonymousSid(); } else { String username = SecurityUtils.getCurrentUsername(); if (username == null) { throw new NullPointerException("SecurityUtils.getCurrentUsername is null"); } sid = new PrincipalSid(username); } return sid; } }
SidUtils { public static Sid createSecurityContextSid() { Sid sid; if (SecurityUtils.currentUserIsSystem()) { sid = createSystemSid(); } else if (SecurityUtils.currentUserIsAnonymous()) { sid = createAnonymousSid(); } else { String username = SecurityUtils.getCurrentUsername(); if (username == null) { throw new NullPointerException("SecurityUtils.getCurrentUsername is null"); } sid = new PrincipalSid(username); } return sid; } private  SidUtils(); }
SidUtils { public static Sid createSecurityContextSid() { Sid sid; if (SecurityUtils.currentUserIsSystem()) { sid = createSystemSid(); } else if (SecurityUtils.currentUserIsAnonymous()) { sid = createAnonymousSid(); } else { String username = SecurityUtils.getCurrentUsername(); if (username == null) { throw new NullPointerException("SecurityUtils.getCurrentUsername is null"); } sid = new PrincipalSid(username); } return sid; } private  SidUtils(); static Sid createSecurityContextSid(); static Sid createUserSid(String username); static Sid createRoleSid(String rolename); static Sid createAuthoritySid(String authority); static String createRoleAuthority(String roleName); static String getRoleName(String authority); static Sid createAnonymousSid(); }
SidUtils { public static Sid createSecurityContextSid() { Sid sid; if (SecurityUtils.currentUserIsSystem()) { sid = createSystemSid(); } else if (SecurityUtils.currentUserIsAnonymous()) { sid = createAnonymousSid(); } else { String username = SecurityUtils.getCurrentUsername(); if (username == null) { throw new NullPointerException("SecurityUtils.getCurrentUsername is null"); } sid = new PrincipalSid(username); } return sid; } private  SidUtils(); static Sid createSecurityContextSid(); static Sid createUserSid(String username); static Sid createRoleSid(String rolename); static Sid createAuthoritySid(String authority); static String createRoleAuthority(String roleName); static String getRoleName(String authority); static Sid createAnonymousSid(); static final String ROLE_PREFIX; }