? .custom_links.admin.inc.swp
? .custom_links.module.swp
Index: custom_links.admin.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/custom_links/custom_links.admin.inc,v
retrieving revision 1.1
diff -u -p -r1.1 custom_links.admin.inc
--- custom_links.admin.inc	27 Jan 2008 09:16:01 -0000	1.1
+++ custom_links.admin.inc	14 Jan 2009 23:48:11 -0000
@@ -136,16 +136,27 @@ function custom_links_form() {
     '#default_value' => $lid ? $link->node_type : NULL,
   );
 
+  $options = array('' => t('No permission required'));
+  foreach (module_list(FALSE, FALSE, TRUE) as $module) {
+    if ($permissions = module_invoke($module, 'perm')) {
+      asort($permissions);
+      foreach ($permissions as $perm) {
+        $options[$module][$perm] = $perm;
+      }
+    }
+  }
   $form['filters']['author_perm'] = array(
-    '#type' => 'textfield',
+    '#type' => 'select',
     '#title' => t('Author permission restriction'),
+    '#options' => $options,
     '#description' => t('A specific permission that the <i>author</i> of the node must have for the link to be added.'),
     '#default_value' => $lid ? $link->author_perm : NULL
   );
 
   $form['filters']['viewer_perm'] = array(
-    '#type' => 'textfield',
+    '#type' => 'select',
     '#title' => t('Viewer permission restriction'),
+    '#options' => $options,
     '#description' => t('A specific permission that the <i>viewer</i> of the node must have for the link to be added.'),
     '#default_value' => $lid ? $link->viewer_perm : 'access content'
   );
