Skip to content

Commit

Permalink
Merge pull request #795 from mlutfy/standaloneUserRole
Browse files Browse the repository at this point in the history
standalone-clean: provide the admin role to the demo user
  • Loading branch information
mlutfy authored Jul 26, 2023
2 parents 318a56c + cef3f30 commit 779bfe5
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions app/config/standalone-clean/demo-user.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@
];
$userID = \CRM_Core_BAO_CMSUser::create($params, $adminEmail);

// @todo decide which permissions the demo user should have; create a role for those; apply the role to the user.
// This code can be added later once the data structures for roles etc. have settled.
// Provide the "Administer" role to the demo user
\Civi\Api4\User::update(FALSE)
->addWhere('id', '=', $userID)
->addValue('roles:name', ['admin'])
->execute();

});

0 comments on commit 779bfe5

Please sign in to comment.