There are a few ways in which you can create complex node access systems. Modules like Taxonomy Access Control and Node Access will allow you to restrict node access in different ways, and work very well for setting up taxonomy or role based access control. There are a few edge cases where you need to restrict access to a node based on some arbitrary conditions like the age of the user or the contents of a field. This is where the build in Drupal access control mechanisms come into play. They do take a little bit of effort to get around how they work, but I hope to enlighten in this post.
One useful function of any application is to report on any errors that occurred. Zend Framework comes with a nice error controller system that you can activate by creating an ErrorController class.
The following is an ErrorController class that I use. It detects what sort of error occurred and displays a message to the user. It will also email a detailed report of the error to the server admins.
As the new Google web browser was released last night (I'm writing this post using the new browser) I thought it would be good to update our readers on the user agent string that this web browser has.
The user agent of any browser can be found out by using the userAgent property of the navigator object. This is available in most modern browsers and is thankfully also present in Google Chrome.
As an example the user agent for FireFox 3 on a Windows XP machine looks like this.
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:18.104.22.168) Gecko/2008070208 Firefox/3.0.1
Using the same code, and the same machine, the user agent produced by Google Chrome is as follows.
You can often forget what you are not running as a super user, so if you type in a command that you can't run with your current set of privileges it will tell give you a permission denied response.
An alternative is to use the !! command to run the last command in the .bash_history. Use this with the sudo command to run the last command as a super user.
- > command
- Permission denied
- > sudo !!