private bool HasPermission(PermissionDefinition permissionDefinition)
        {
            if (!AbpUser.CurrentUserId.HasValue)
            {
                return(false);
            }

            var roleNames = _userRoleManager.GetRolesOfUser(AbpUser.CurrentUserId.Value);
            var granted   = permissionDefinition.IsGrantedByDefault;

            foreach (var roleName in roleNames)
            {
                var permissionSetting = _roleManager.GetPermissionOrNull(roleName, permissionDefinition.Name);
                if (permissionSetting == null)
                {
                    continue;
                }

                if (permissionSetting.IsGranted)
                {
                    return(true); //Granted if any of role is granted
                }

                granted = false; //Denied for this role. Set false but check other roles
            }

            return(granted);
        }