Created the setDefaultState method to be accessed from toolbar.as to set the default state of any button object. setButtonState methods to be accessed from anywhere to change the state of button to enable/disable.
When getting the contents of a folder, check the permissions on subfolders, not just on folder itself. Otherwise the client displays subfolders that the user has no access to (e.g. other user's home folders).