I am trying out the new HasFlags features, and was wondering if the following should work:
enum.HasFlag(AccessRights.Read | AccessRights.Writ
Alternatively, you could just reverse the order of the expression:
//returns true - a bit easier on the eye
(AccessRights.Read | AccessRights.Write).HasFlag(myAccessRights)
This will return true if you have either Read | Write access. That would be functionally equivalent to:
//also returns true - as per @Ani's answer
myAccessRights & (AccessRights.Read | AccessRights.Write) != 0
EDIT
As pointed out in the comments, The first expression will return true if myAccessRights is empty, and false if myAccessRights has more than just Read and Write.