#329 ✓not-applicable
John W Higgins

[PATCH] Protection level for properties

Reported by John W Higgins | May 30th, 2008 @ 11:18 PM

The following patch against edge DM will allow for protecting properties from mass-update. Naming conventions and such are not locked down so I decided to just post a patch as opposed to pushing up the patch to github

Comments and changes to this ticket

  • Dan Kubb (dkubb)

    Dan Kubb (dkubb) November 30th, 2008 @ 12:53 PM

    • Assigned user changed from “Sam Smoot” to “Dan Kubb (dkubb)”
    • Title changed from “[Patch] Protection level for properties” to “[PATCH] Protection level for properties”

    John, I committed something to dkubb/dm-core the other day that provides some protection for mass-assignment. Could you review the following and let me know if it meets your needs:

    http://github.com/dkubb/dm-core/...

    When defining your properties you can use the :accessor or :writer attribute to specify if it's :public, :private or :protected. You can also use the Kernel public()/private(),protected() methods to explicitly set the mutator "scope". The basic idea of this is that it will only allow mass-assignment for public mutators.

    While it's not quite the same as your patch it can be used to accomplish most of the same goals.

  • Dan Kubb (dkubb)

    Dan Kubb (dkubb) November 30th, 2008 @ 01:41 PM

    • State changed from “new” to “hold”
  • Dan Kubb (dkubb)

    Dan Kubb (dkubb) December 4th, 2008 @ 03:03 AM

    • State changed from “hold” to “not-applicable”

    John, I haven't heard back from you, so I'm going to close this ticket for now.

    It's unlikely dm-core will ever support a comprehensive parameter protection system though. It seems as if everyone and every application has their own interpretation of how this should be done, and before we make any changes to dm-core we'd require a few implementation to be made into plugins and see how they function in the real-world.

    The danger with adding it too soon into dm-core is that if there are flaws it will be difficult to change since everyone will have systems built on top of it. Much better to provide a simple API and encourage people to build and evolve plugins on top of it.

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

People watching this ticket

Attachments

Pages