What's new in EzyPlatform 1.5.1?
This release focuses on expanding per-API permission control, improving the Role system for Admins and Users, and optimizing login and callback URL flows across both Admin and Web.
-
Added an Event to control API permission checksAdded the
check_api_user_permission_requiredEvent, allowing applications to decide on a per-request basis whether user permission checks are required. The Event receivesfeature,method,uriTemplate, anduserId. A result oftruerequires a permission check,falseskips the check, andnulluses the platform's default behavior. -
Added Feature configuration for multiple Roles
WebRoleFeatureConfighas been extended withgetFeaturesMapByRoleName(), allowing a single configuration to define Features for multiple Roles instead of being limited to one Role. Configuration dependencies are also automatically bound and now provide setters for easier extension and customization. -
Added APIs for assigning Roles by nameAdded
saveAdminRolesByAdminIdAndRoleNames()andsaveUserRolesByUserIdAndRoleNames()to assign Roles to Admins or Users directly by Role name. Assigning Roles to an Admin by ID is now idempotent, preventing duplicate records from being created when the same Role has already been assigned. -
Added batch Role lookup APIsAdded
findByNameIn(),getRoleIdsByNames(),getRoleIdMapByNames(),getRoleMapByIds(), andgetRoleNameMapByIds(). These APIs allow multiple Roles to be retrieved in a single operation, reducing the number of database queries when applications need to process multiple Roles at once. -
Improved the Admin login flowBefore redirecting to the login page, Admin now stores the current URL as the Callback URL. After a successful login, users are redirected back to the correct previous page, and the Callback Cookie is cleared after use. The Callback Cookie is created only when the URL is valid, providing a more accurate and secure redirect flow.
-
Improved the Web login flow
ezyweb.redirectToLogin()now stores the current path and query parameters insessionStorage.loginCallbackUrlbefore redirecting users to the login page. An existing callback is not overwritten when the user is on/loginor/register, ensuring that users return to the correct original page after completing the login process. -
Extended WebAuthenticationInterceptor customization
WebAuthenticationInterceptorhas been extended so subclasses can customizegetAccessToken(),needToCheckPermission(...), andcheckPermission(...). This gives applications greater flexibility when implementing custom Access Token retrieval, deciding when permission checks are required, or providing their own Permission logic.