public bool HasWriteAccessForCustomer(int CustomerID)
        {
            // Always return true if we are working with offline/local file envrionment
            if (this.OfflineAndLocalFilesOnly == true)
            {
                return(true);
            }

            RBACCustomerInfoPredicate customerPredicate = new RBACCustomerInfoPredicate(CustomerID);

            RBACToolbox.RBACCustomerInfo grantedCustomer = this.GrantedCustomers.Find(customerPredicate.CompareByCustomerID);
            if (grantedCustomer != null)
            {
                RBACItemInfo grantedItem = null;

                // User access to customer, so we will assume they have read/write access also.  However, if they have the
                // "ReadOnlyAccess" role, then we will return false

                RBACItemInfoPredicate rolePredicate = new RBACItemInfoPredicate("ReadOnlyAccess", RBACItemType.Role);
                grantedItem = this.GrantedItems.Find(rolePredicate.CompareByNameAndItemType);
                if (grantedItem != null)
                {
                    return(false);
                }
                else
                {
                    return(true);
                }
            }
            else
            {
                // User doesn't have access to customer at all (not even to read)
                return(false);
            }
        }
        // Compare by both Name and ItemType
        public bool CompareByNameAndItemType(RBACItemInfo pObject)
        {
            bool result = (System.String.Compare(pObject.ItemName, _CompareItemName, false) == 0);

            if (result == true)
            {
                result = (pObject.ItemType.CompareTo(_CompareItemType) == 0);
            }
            return(result);
        }
        public bool HasGrantedItem(string itemName)
        {
            RBACItemInfo          grantedItem   = null;
            RBACItemInfoPredicate rolePredicate = new RBACItemInfoPredicate(itemName, RBACItemType.Role);

            grantedItem = this.GrantedItems.Find(rolePredicate.CompareByNameAndItemType);
            if (grantedItem != null)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
 // Compare by ID
 public bool CompareByItemID(RBACItemInfo pObject)
 {
     return(pObject.ItemID == _CompareItemID);
 }
 // Compare by Name (Case-Insensitive)
 public bool CompareByName_CaseInsensitive(RBACItemInfo pObject)
 {
     return(System.String.Compare(pObject.ItemName, _CompareItemName, true) == 0);
 }
 // Compare by Name (Case-Sensitive)
 public bool CompareByName(RBACItemInfo pObject)
 {
     return(System.String.Compare(pObject.ItemName, _CompareItemName, false) == 0);
 }