Question: Is it possible to limit access to a page using wordpress user roles that isn't included in the wordpress install.

For example I have a CS Cart install with only a couple of products but I need to limit access to these pages to certain users.

Can I add something in to my CS Cart install to call on Wordpress to be able to limit access if the user is just a subscriber?

Answer: 
This is certainly possible but will require you to alter CS Cart a titbit. I'm not too familiar with CS Cart's inner workings, from the little that I've explored the source code (they actually make you fill in a form to download a community edition, bleh) you would want to do something of this kind:

```
$current_working_directory = getcwd();
chdir( 'WORDPRESS_ROOT' ); // load up 
require_once 'wp-load.php'; // possibly with SHORTINIT to reduce load
// include wp-includes/capabilities.php if SHORTINIT
// include wp-includes/user.php and other dependencies
$permission = current_user_can( 'browse_cs_cart_page' );
chdir( $current_working_directory );

if ( !$permission ) {
    die( 'You do not have permission to access this page. Please login in my WordPress site before you can proceed to here' );
} else {
    // show page
}

```

This would probably be part of a plugin.

Now, `current_user_can` will use the cookies that WordPress reads and compares to issued cookies to users. Without a plugin like [Root Cookie](http://wordpress.org/extend/plugins/root-cookie/) WordPress will not be able to read it (although, if you're saying that it's in the same root directory and the domain is the same you should be able to pull it off without fiddling with cookies, the browser should send them to both WordPress and CS Cart, check with your debug tool of choice).

[`SHORTINIT`](http://core.trac.wordpress.org/browser/tags/3.3.1/wp-settings.php#L98) is not mandatory but should improve the speed and memory consumption a bit if you're worried about performance.

This all is fairly easy and should require no more than a couple of hours of fiddling on the CS Cart side (writing a plugin i.e.). WordPress takes care of the rest. Good luck and let us know how it goes.

Further reading:

1. <http://wordpress.org/support/topic/load-wp-core-in-another-framework-shortinit-wp_query>
2. <http://core.trac.wordpress.org/browser/tags/3.3.1/wp-includes/capabilities.php#L839>
3. <http://docs.cs-cart.com/common.php?dispatch=docs/view&node_name=addons>
4. <http://open-source-experiments.blogspot.com/2009/02/setting-up-common-login-across-multiple.html>
No, it is not possible, not cleanly anyway

There are kludges that will get you half there but they are ugly, and trivial to bypass, making it a waste of time, and time is money. It would thus be insecure, costly to build, and costly to maintain, without actually delivering the goal.

You would be far better off going with a piece of software that integrates directly into WordPress, such as an eCommerce plugin, most of which are free and have a lot of features, e.g.:

* Jigoshop
* WooCommerce
* WP-Ecommerce