Index: openacs-4/packages/acs-core-docs/www/how-do-I.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/how-do-I.adp,v diff -u -r1.5.2.10 -r1.5.2.11 --- openacs-4/packages/acs-core-docs/www/how-do-I.adp 1 Aug 2024 08:03:39 -0000 1.5.2.10 +++ openacs-4/packages/acs-core-docs/www/how-do-I.adp 2 Sep 2024 09:40:22 -0000 1.5.2.11 @@ -2,11 +2,14 @@ {/doc/acs-core-docs/ {ACS Core Documentation}} {How Do I?} How Do I? +

@@ -57,9 +60,7 @@ examine how this works:

  • A templated page uses an ADP/Tcl pair. The first line in the ADP -file is usually:

    -<master>
    -

    If it appears exactly like this, without any arguments, the +file is usually:

    <master>

    If it appears exactly like this, without any arguments, the template processor uses default-master for that subsite. For pages in /var/lib/aolserver/$OPENACS_SERVICE_NAME/www, this is /var/lib/aolserver/$OPENACS_SERVICE_NAME/www/default-master.adp @@ -85,43 +86,39 @@ diagnose a permissions problem?

  • -Steps to Reproduce. The events -package does not allow users to register for new events.

      +Steps to Reproduce. The events package +does not allow users to register for new events.

      1. Go to the http://yourserver.net/events as a visitor (ie, log out and, if necessary, clear cookies). This in on a 4.6.3 site with events version 0.1d3.

      2. Select an available event

      3. A link such as Registration: -Deadline is 03/15/2004 10:00am. » Login or sign up to -register for this event. is visible. Click on "Login or -sign up"

      4. Complete a new registration. Afterwards, you should be +Deadline is 03/15/2004 10:00am. » Login or sign up to register for +this event. is visible. Click on "Login or sign +up"

      5. Complete a new registration. Afterwards, you should be redirected back to the same page.

      Actual Results: The page says "You do not have permission to register for this event."

      Expected results: A link or form to sign up for the event is shown.

    1. -Finding the problem. We start with -the page that has the error. In the URL it's http://myserver.net/events/event-info.tcl, +Finding the problem. We start with the +page that has the error. In the URL it's http://myserver.net/events/event-info.tcl, so open the file /var/lib/aolserver/$OPENACS_SERVICE_NAME/packages/events/www/event-info.tcl. -It contains this line:

      -set can_register_p [events::security::can_register_for_event_p -event_id $event_id]
      -

      We need to know what that procedure does, so go to /api-doc, paste +It contains this line:

      set can_register_p [events::security::can_register_for_event_p -event_id $event_id]

      We need to know what that procedure does, so go to /api-doc, paste events::security::can_register_for_event_p into the ACS Tcl API Search box, and click Feeling Lucky. The next pages shows the proc, and we click "show source" to see more information. The -body of the proc is simply

      -return [permission::permission_p -party_id $user_id -object_id $event_id -privilege write]
      -

      This means that a given user must have the write privilege on +body of the proc is simply

      return [permission::permission_p -party_id $user_id -object_id $event_id -privilege write]

      This means that a given user must have the write privilege on the event in order to register. Let's assume that the privileges inherit, so that if a user has the write privilege on the whole package, they will have the write privilege on the event.

    2. -Setting Permissions. A permission -has three parts: the privilege, the object of the privilege, and -the subject being granted the privilege. In this case the privilege -is "write," the object is the Events package, and the +Setting Permissions. A permission has +three parts: the privilege, the object of the privilege, and the +subject being granted the privilege. In this case the privilege is +"write," the object is the Events package, and the subject is all Registered Users.

      1. To grant permissions on a package, start at the site map. Find the event package and click "Set permissions".

      2. Click "Grant Permission"

      3. @@ -131,8 +128,8 @@

    OpenACS 5.0 offers a prettier version at /admin/applications.

    -

    Figure 4.3. Granting Permissions in -5.0

    Granting Permissions in 5.0
    +

    Figure 4.3. Granting Permissions +in 5.0

    Granting Permissions in 5.0

@@ -141,8 +138,7 @@ \ No newline at end of file