¨4.0.1¨

This commit is contained in:
¨NW¨
2023-12-03 14:07:47 +00:00
parent c08b36d1b6
commit f35052522d
1112 changed files with 43019 additions and 24987 deletions

View File

@@ -4,6 +4,7 @@ namespace Modules\User\Contracts;
use Modules\User\Entities\Role;
use Modules\User\Entities\User;
use Cartalyst\Sentinel\Activations\ActivationInterface;
interface Authentication
{
@@ -12,44 +13,54 @@ interface Authentication
*
* @param array $credentials
* @param bool $remember
*
* @return mixed
*/
public function login($credentials, $remember = false);
/**
* Register a new user.
*
* @param array $data
*
* @return bool
*/
public function register($data);
/**
* Register and activate a new user.
*
* @param array $data
* @return \Modules\User\Entities\User
*
* @return User
*/
public function registerAndActivate($data);
/**
* Activate the given used id.
*
* @param int $userId
* @param string $code
*
* @return mixed
*/
public function activate($userId, $code);
/**
* Assign a role to the given user.
*
* @param \Modules\User\Entities\User $user
* @param \Modules\User\Entities\Role $role
* @param User $user
* @param Role $role
*
* @return void
*/
public function assignRole(User $user, Role $role);
/**
* Log the user out of the application.
*
@@ -57,48 +68,59 @@ interface Authentication
*/
public function logout();
/**
* Create an activation code for the given user.
*
* @param \Modules\User\Entities\User $user
* @return \Cartalyst\Sentinel\Activations\ActivationInterface
* @param User $user
*
* @return ActivationInterface
*/
public function createActivation(User $user);
/**
* Create a reminders code for the given user.
*
* @param \Modules\User\Entities\User $user
* @param User $user
*
* @return string
*/
public function createReminderCode(User $user);
/**
* Completes the reset password process.
*
* @param \Modules\User\Entities\User $user
* @param User $user
* @param string $code
* @param string $password
*
* @return bool
*/
public function completeResetPassword(User $user, $code, $password);
/**
* Determines if the current user has access to the given permissions.
*
* @param array|string $permissions
*
* @return bool
*/
public function hasAccess($permissions);
/**
* Determine if the user has access to the any given permissions
* Determine if the user has access to any given permissions
*
* @param array|string $permissions
*
* @return bool
*/
public function hasAnyAccess($permissions);
/**
* Check if the user is logged in.
*
@@ -106,13 +128,15 @@ interface Authentication
*/
public function check();
/**
* Get the currently logged in user.
* Get the currently logged-in user.
*
* @return \Modules\User\Entities\User
* @return User
*/
public function user();
/**
* Get the ID for the currently authenticated user.
*