--- creativecommons_lite.module_org	2008-12-15 17:34:31.000000000 -0700
+++ creativecommons_lite.module	2009-03-10 07:05:44.000000000 -0600
@@ -28,7 +28,7 @@ function para() {
  * Implementation of hook_perm().
  */
 function creativecommons_lite_perm() {
-  return array('administer creative commons lite');
+  return array('administer creative commons lite', 'restrict to default cc license', 'override cc license restriction');
 }
 
 
@@ -298,21 +298,31 @@ function creativecommons_lite_block($op=
 function creativecommons_lite_get_license_array($options = NULL) {
   $types = array();
   
-  $types['by'] = t('Attribution');
-  $types['by-nd'] = t('Attribution No Derivatives');
-  $types['by-nc-nd'] =  t('Attribution Non-commercial No Derivatives');
-  $types['by-nc'] = t('Attribution Non-commercial');
-  $types['by-nc-sa'] = t('Attribution Non-commercial Share Alike');
-  $types['by-sa'] =  t('Attribution Share Alike');
-  $types['publicdomain'] = t('Public Domain');
-  
-  // Only include the provided options
-  if (is_array($options)) {
-    $types = array_intersect_key($types, $options);
+  // if user is restricted to default cc license and not in a role that overrides cc license restriction
+  if (!user_access('override cc license restriction') && user_access('restrict to default cc license')) {
+  
+      //only include the Attribution Non-commercial Share Alike license
+  	  $types['by-nc-sa'] = t('Attribution Non-commercial Share Alike');
+      
+  } else {
+  	  $types['by'] = t('Attribution');
+	  $types['by-nd'] = t('Attribution No Derivatives');
+	  $types['by-nc-nd'] =  t('Attribution Non-commercial No Derivatives');
+	  $types['by-nc'] = t('Attribution Non-commercial');
+	  $types['by-nc-sa'] = t('Attribution Non-commercial Share Alike');
+	  $types['by-sa'] =  t('Attribution Share Alike');
+	  $types['publicdomain'] = t('Public Domain');
+  
+	 // Only include the provided options
+	 if (is_array($options)) {
+	   $types = array_intersect_key($types, $options);
+	 }
+	 
+	 // Add an empty option to the beginning of the types
+  	$types = array_merge(array('' => ''), $types);
   }
   
-  // Add an empty option to the beginning of the types
-  $types = array_merge(array('' => ''), $types);
+  
   
   return $types;
 }
