function view_unpublished_perm in view_unpublished 5
Same name and namespace in other branches
- 6 view_unpublished.module \view_unpublished_perm()
File
- ./
view_unpublished.module, line 8
Code
function view_unpublished_perm() {
$perms = array(
'use view_unpublished module',
'view all unpublished content',
'edit all unpublished content',
);
$types = db_query("select type from {node_type}");
$i = 0;
while ($type = db_result($types, $i++)) {
$perms[] = 'view unpublished ' . $type . ' content';
$perms[] = 'edit unpublished ' . $type . ' content';
}
return $perms;
}