I propose that we add a 'getPrimaryPrincipal()' method to the
PrincipalCollection interface.

We regularly talk about the 'primary' principal, and it is referenced
in many applications, but you need to resort to less-than-ideal ways
of accessing it (see
https://svn.apache.org/repos/asf/incubator/shiro/trunk/core/src/main/java/org/apache/shiro/realm/AuthorizingRealm.java
- 'getAvailablePrincipal' - at the bottom of the file).

Most applications reference a single principal at runtime (e.g.
user/account ID), and I think it would clean up code.

Thoughts?

Reply via email to