Skip to content

lfabbric/sanitize-models

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SanitizeModels

Purpose

Identify and exclude fields from objects and nested objects when using the renderWith feature. An example would be to exclude a hashpassword and lastipaddress when rendering JSON

Installation

Copy zip file to your plugins folder. It should just work.

Basics

You can either set an overriding setting to ensure that every renderWith method is sanitized or you can specify during each use.

config/settings.cfm

<cfset set(functionName="renderWith", sanitize=true)>

controllers

renderWith(data=item, sanitize=true);

Setup

identify fields that should be sanitized from your Model components.

    component extends="Model" {

        public function init() {
            table("tableName");
            ...
            excludeFields(['hashedpassword','lastipaddress']);
            return this;
        }
        ...
}

About

No description or website provided.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published