Skip to content
This repository was archived by the owner on Nov 11, 2025. It is now read-only.
This repository was archived by the owner on Nov 11, 2025. It is now read-only.

Use with update and sequelize 3.0 #6

@gonzobrandon

Description

@gonzobrandon

Having a hard time using ssacl-attribute-roles with sequelize 2.0...

I want to update a record, but conform to aacl roles I set..e.g.:

var Devices = sequelize.define('devices', {});

    ssaclAttributeRoles(sequelize);
    ssaclAttributeRoles(Devices);

    Devices = sequelize.define("devices", {
        Name: {
            type: DataTypes.STRING,
            roles: {
                admin: true,
                public: false
            }
        }, 

// Then in a controller:

Devices.update(
        {
            Name: 'foobar'
        }
        {
            where: whereClause
            role: 'public'
        }
    ); //This should not work, right?

I have also tried:

Devices.findOne(
        {
            where: whereClause
        }).then(function(record) {
             record.set({Name: 'foobar'}, {role: 'public'});

             record.update(record.dataValues, {where:whereClause})
})

It still writes to the DB despite public being forbidden. Help anyone?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions