From efd6fce58587dd9056bfcaba8e9b5b900912c8b9 Mon Sep 17 00:00:00 2001
From: martinlanghoff <martinlanghoff>
Date: Wed, 19 Sep 2007 07:24:43 +0000
Subject: [PATCH] accesslib: require_capability() phpdoc notes

---
 lib/accesslib.php | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/lib/accesslib.php b/lib/accesslib.php
index 232f6ab230..a55faf894f 100755
--- a/lib/accesslib.php
+++ b/lib/accesslib.php
@@ -31,6 +31,7 @@
  *
  * - get_context_instance() 
  * - has_capability()
+ * - require_capability()
  * - get_user_courses_bycap()
  * - get_context_users_bycap()
  * - get_parent_contexts()
@@ -619,8 +620,15 @@ function aggr_roles_fad($context, $ad) {
 }
 
 /**
- * This function checks for a capability assertion being true.  If it isn't
- * then the page is terminated neatly with a standard error message
+ * This is an easy to use function, combining has_capability() with require_course_login().
+ * And will call those where needed.
+ * 
+ * It checks for a capability assertion being true.  If it isn't
+ * then the page is terminated neatly with a standard error message.
+ *
+ * If the user is not logged in, or is using 'guest' access or other special "users,
+ * it provides a logon prompt.
+ *
  * @param string $capability - name of the capability
  * @param object $context - a context object (record from context table)
  * @param integer $userid - a userid number
-- 
2.39.5