+ // all shared creds are placed into mSessionCreds
+ // all non shared creds are placed into AuthorizationToken
+ //
+ // There are 2 types of credentials UID and Right
+ // UID = Authenticated Identity
+ // Right = Rights which were previously authenticated by a uid credential
+
+ // Right Credentials are only used during kAuthorizationFlagLeastPrivileged
+ // operations and should not have a valid uid set
+
+ // this allows shared and none shared co-exist in the same container
+ // used when processing multiple rights shared vs non-shared during evaluation
+ if (!mShared && other.mShared)
+ return true;
+ if (!other.mShared && mShared)
+ return false;
+
+ // this allows uids and rights co-exist in the same container
+ // used when holding onto Rights inside of the AuthorizationToken
+ if (mRight && !other.mRight)
+ return true;
+ if (!mRight && other.mRight)
+ return false;
+
+ // this is the actual comparision
+ if (mRight) {
+ return mName < other.mName;
+ } else {