Where can I get permission string to use with user_access? There is a long permission list at admin/people/permissions.
For example there is permission with title Article: Edit any content.
But where can I get the string which can be used with function user_access()?
Pop Devel on your site and head to yoursite.com/devel/php and enter the following:

$permissions = module_invoke('node', 'permission');
dsm($permissions);


The key for each part of the array will be the string you want to apply the permission.

The following will get a list of permissions on every enabled module on your site (modules sorted by name):

foreach (module_list(FALSE, FALSE, TRUE) as $module) {
  if ($permissions = module_invoke($module, 'permission')) {
    // Print the module title
    dsm($module);
    // Print the permisions
    dsm($permissions);
  }
}