Skip to content

Latest commit

 

History

History
404 lines (202 loc) · 16.6 KB

CHANGELOG.md

File metadata and controls

404 lines (202 loc) · 16.6 KB

Change Log

All notable changes to this project will be documented in this file.

8.0.2 (2024-06-16)

Bug Fixes

  • deps: fixes @casl/ability peer dep for @casl/mongoose (#925) (c7f3d09)

8.0.1 (2024-03-27)

Bug Fixes

  • gets rid of dist imported types which cannot be resolved at runtime (#895) (29f2d90)

8.0.0 (2024-03-27)

BREAKING CHANGES

  • accessibleBy is now just a POJO which has ofType method to get query for specific type
  • mongoose accessibleRecordsPlugin doesn't throw exception anymore if ability forbids to do an action and instead it sends empty result query to MongoDB

Features

  • adds accessibleBy and accessibleFieldsBy to casl-mongoose (#880) (42745d6)

7.2.2 (2024-01-31)

7.2.1 (2023-07-28)

Bug Fixes

  • changes empty result query to be $expr with object, otherwise mongoose throws error (9eae155)

7.2.0 (2023-07-22)

Bug Fixes

Features

  • adds accessibleBy helper and deprecates toMongoQuery and accessibleRecordsPlugin (#795) (bd58bb2)

7.1.3 (2023-05-05)

7.1.2 (2022-10-30)

Bug Fixes

  • fixes type in mongoose error message (1d28496)

7.1.1 (2022-10-30)

Bug Fixes

  • adds unlessCan method to ForbiddenError and reused it mongoose package to construct ForbiddenError (be7ae6a)

7.1.0 (2022-08-28)

Bug Fixes

  • ensure acessible plugins can work with Ability instance that uses classes as SubjectTypes (7e9b634), closes #656

Features

  • exports types to support TS ES6 modules (c818b1a), closes #668

7.0.0 (2022-07-29)

Features

  • allow to use mongoose typings without extending Document (#639) (f5273e3)

BREAKING CHANGES

  • increased mongoose version to 6.0.13 in order to use 4 generic types in Model type

6.0.1 (2022-07-25)

6.0.0 (2021-11-04)

Bug Fixes

  • ensure it's possible to chain accessibleBy after another accessibleBy and combine with other Query methods (5632c53)
  • package: add repository directory into package.json for all @casl/* packages (#560) (0ef534c)

Features

  • update mongoose to v6 and use mongoose-v6 QueryWithHelpers interface (#561) (a5f1036)

BREAKING CHANGES

  • updates mongoose and related ts types to v6

5.0.1 (2021-05-12)

Bug Fixes

  • adjusts package tags to improve discoverability (73e88b0)

5.0.0 (2021-05-10)

Code Refactoring

  • mongoose: migrates @casl/mongoose to official mongoose types (0379e7b), closes #436

BREAKING CHANGES

  • mongoose: migrates @casl/mongoose to official mongoose types. This is a breaking change for TypeScript users. What you need to do is to

    npm uninstall @types/mongoose

    and extend model interfaces by mongoose.Document

    Before

    interface Post {
      title: string;
      content: string;
    }
    
    const schema = new mongoose.Schema<Post>({
      // model definition
    });

    After

    import mongoose from "mongoose";
    
    interface Post extends mongoose.Document {
      title: string;
      content: string;
    }
    
    const schema = new mongoose.Schema<Post>({
      // model definition
    });

    For example, check updated README.md

4.0.2 (2021-04-12)

Bug Fixes

  • mongoose: uses mongoose as commonjs module (c98506b)

4.0.1 (2021-02-12)

Bug Fixes

  • changelog: removes unrelated entries from changelog (5437622)

4.0.0 (2021-02-12)

Features

  • mongoose: throws ForbiddenError instead of returning a hard-coded value when user has not permissions to do some action (917dd01), closes #404

BREAKING CHANGES

  • mongoose: accessibleBy eventually throws ForbiddenError instead of returning a hard-coded value

    Before:

    // ability doesn't allow to read Post
    const ability = defineAbility(can => can('manage', 'Comment'));
    
    try {
      const items = await Post.accessibleBy(ability, 'read');
      console.log(items); // []
    } catch (error) {
      console.error(error); // no error thrown
    }

    After:

    // ability doesn't allow to read Post
    const ability = defineAbility(can => can('manage', 'Comment'));
    
    try {
      const items = await Post.accessibleBy(ability, 'read');
      console.log(items); // not reached, because query fails with error
    } catch (error) {
      console.error(error); // ForbiddenError thrown
    }

3.2.2 (2021-01-05)

Bug Fixes

  • mongoose: simplifies types for toMongoQuery helper (1615f4b)

3.2.1 (2020-12-28)

Bug Fixes

  • dist: adds separate tsconfig.build.json to every completementary project (87742ce), closes #419

3.2.0 (2020-12-26)

Bug Fixes

  • angular: fixes sourcemap generation for the code built by ngc (7715263), closes #387 #382
  • package: removes engine section that points to npm@6 (eecd12a), closes #417

Features

  • esm: adds ESM support for latest Node.js through exports prop in package.json (cac2506), closes #331

3.1.0 (2020-08-20)

Features

  • mongoose: adds getFields option to accessibleFieldsPlugin (a93037c)

3.0.3 (2020-06-09)

Bug Fixes

  • docs: ensure README and docs for all packages are in sync (8df3684), closes #338

3.0.2 (2020-04-10)

Bug Fixes

  • mongoose: ensure that terser doesn't mangle reserved required props (83f1d32)

3.0.1 (2020-04-09)

Bug Fixes

  • mongoose: adds support for casl/ability@4 in package.json (ffb887c)

3.0.0 (2020-04-09)

Bug Fixes

  • mongoose: ensures mongoose works with MongoQuery conditions (f92b7df), closes #249
  • mongoose: fixes mongoose typings (d320eba), closes #248

Features

  • mongoose: adds generics to mongoose types (6cdf82e), closes #256
  • mongoose: simplifies generics for mongoose (7ff65f7), closes #107

BREAKING CHANGES

  • mongoose: removes deprecated permittedFieldsPlugin use accessibleFieldsPlugin instead
  • typescript: weak hand written declaration files are removed as @casl/mongoose has been completely rewritten to TypeScript.

2.3.3 (2020-03-13)

Bug Fixes

  • mongoose: adds missing index.js file (804c0dd)
  • mongoose: makes sure abilityConditions does not override existing $and conditions (#273) (c13300f), closes #272

Bug Fixes

  • mongoose: mock query result on collection level (1e8c241), closes #218

Bug Fixes

Features

  • mongoose: wraps resulting query into additional $and (1af1c54), closes #140

Bug Fixes

  • mongoose: adds optional options as null type (#127) (ac3c262)

Bug Fixes

  • mongoose: sets the correct this for deprecated methods (488a227), closes #116

Bug Fixes

  • angular: adding type definitions for accessibleFields (#117) (a00c02b)
  • README: changes links to @casl/ability to point to npm package instead to git root [skip ci] (a74086b), closes #102

Features

  • react:can: updates typescript declarations (213dcde)

Bug Fixes

  • mongoose: accessibleBy now doesn't change query type (da7ed74), closes #87

2.1.1 (2018-05-06)

Bug Fixes

2.1.0 (2018-04-17)

Bug Fixes

  • mongoose: returns empty result set for Query#count (f89dfb9), closes #52
  • typescript: fixes typings (d5fc51c), relates to #18

Features

2.0.2 (2018-04-16)

Bug Fixes

  • mongoose: returns empty result set for Query#count (f89dfb9), closes #52
  • typescript: updates d.ts files (d5fc51c), closes #18

2.0.1 (2018-03-23)

Features

  • package: adds mongoose plugin
  • package: adds MongoDB query builder