core/server/services/permissions/can-this.js
function (perm) {
                        var permObjId;

                        // Look for a matching action type and object type first
                        if (perm.get('action_type') !== actType || perm.get('object_type') !== objType) {
                            return false;
                        }

                        // Grab the object id (if specified, could be null)
                        permObjId = perm.get('object_id');

                        // If we didn't specify a model (any thing)
                        // or the permission didn't have an id scope set
                        // then the "thing" has permission
                        if (!modelId || !permObjId) {
                            return true;
                        }

                        // Otherwise, check if the id's match
                        // TODO: String vs Int comparison possibility here?
                        return modelId === permObjId;
                    }
function (perm) {
                        var permObjId;

                        // Look for a matching action type and object type first
                        if (perm.get('action_type') !== actType || perm.get('object_type') !== objType) {
                            return false;
                        }

                        // Grab the object id (if specified, could be null)
                        permObjId = perm.get('object_id');

                        // If we didn't specify a model (any thing)
                        // or the permission didn't have an id scope set
                        // then the "thing" has permission
                        if (!modelId || !permObjId) {
                            return true;
                        }

                        // Otherwise, check if the id's match
                        // TODO: String vs Int comparison possibility here?
                        return modelId === permObjId;
                    }
function ( perm ) { var permObjId ; // Look for a matching action type and object type first if ( perm . get ( 'action_type' ) !== actType || perm . get ( 'object_type' ) !== objType ) { return false ; } // Grab the object id (if specified, could be null) permObjId = perm . get ( 'object_id' ) ; // If we didn't specify a model (any thing) // or the permission didn't have an id scope set // then the "thing" has permission if ( ! modelId || ! permObjId ) { return true ; } // Otherwise, check if the id's match // TODO: String vs Int comparison possibility here? return modelId === permObjId ; }
Iterate through the user permissions looking for an affirmation
Iterate through the user permissions looking for an affirmation