Commit 0d5fa341 authored by Reva Gomes's avatar Reva Gomes
Browse files

Restrict account settings route access to owner/admin

parents c213b400 85d32a03
Loading
Loading
Loading
Loading
Loading
+17 −1
Changes for .cspell.json: 17 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -66,6 +66,22 @@
    "ConfigEntityListBuilder",
    "EntityDeleteForm",
    "EntityForm",
    "BlockBase"
    "BlockBase",
    "drupalcon",
    "staticflickr",
    "dateupload",
    "recenttracks",
    "mymodule",
    "flickruser",
    "overwriter",
    "deleter",
    "dedup",
    "Dedup",
    "testuser",
    "somekey",
    "twitteruser",
    "addtogroup",
    "endcode",
    "unserialized"
  ]
}
+1 −1
Changes for README.md: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -50,7 +50,7 @@ Any module can register a new service type and provide items for it.

2. **Add per-user config fields** in `hook_form_actstream_accounts_form_alter()` — append fields to the accounts form and attach a submit handler that calls `actstream_account_save()`.

3. **Fetch items** in `hook_actstream_SERVICE_items_fetch()` — contact the remote API and return normalised item arrays. Each item needs `title`, `body`, `link`, `timestamp`, `guid`, and ideally `raw`.
3. **Fetch items** in `hook_actstream_SERVICE_items_fetch()` — contact the remote API and return normalized item arrays. Each item needs `title`, `body`, `link`, `timestamp`, `guid`, and ideally `raw`.

4. **Optionally alter items** in `hook_actstream_SERVICE_items_alter()` — filter, enrich, or reorder items before they are saved.

+2 −4
Changes for actstream.api.php: 2 added lines, 4 removed lines.
Original line number Diff line number Diff line
@@ -192,7 +192,7 @@ function hook_form_actstream_accounts_form_alter(
 * hook_actstream_github_items_fetch().
 *
 * This hook is called during cron and on manual refresh. It should contact
 * the remote API and return an array of normalised item arrays.
 * the remote API and return an array of normalized item arrays.
 *
 * Each item array must contain the following keys:
 * - title (string, required): Short human-readable title used as the entity
@@ -205,7 +205,7 @@ function hook_form_actstream_accounts_form_alter(
 *   provided by the remote service. Used for de-duplication. If the service
 *   does not provide a GUID, use the canonical link URL.
 * - raw (string, desired): The verbatim service response for this item
 *   (serialised JSON, XML, etc.) stored in the actstream_raw field for
 *   (serialized JSON, XML, etc.) stored in the actstream_raw field for
 *   archiving and future re-processing. Omitting this key is allowed but
 *   discouraged.
 *
@@ -392,8 +392,6 @@ function hook_actstream_SERVICE_items_alter(
 * @endcode
 */
function hook_preprocess_actstream_item(array &$variables): void {
  /** @var \Drupal\actstream\Entity\ActivityStreamItem $item */
  $item    = $variables['actstream_item'];
  $service = $variables['service'];

  // Example: append the service name to the object link title.
+1 −1
Changes for actstream.routing.yml: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -37,7 +37,7 @@ actstream.user_accounts:
    _form: '\Drupal\actstream\Form\ActivityStreamAccountsForm'
    _title: 'Activity Stream accounts'
  requirements:
    _permission: 'access content'
    _entity_access: 'user.update'
  options:
    parameters:
      user:
+1 −0
Changes for actstream_event/src/Entity/ActstreamEventInterface.php: 1 added line, 0 removed lines.
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@ interface ActstreamEventInterface extends ConfigEntityInterface {
   * Returns the list of service IDs to aggregate for this event.
   *
   * @return string[]
   *   The service IDs.
   */
  public function getServices(): array;

Loading