{"action":"closed","issue":{"url":"https://api.github.com/repos/softlayer/sl-ember-behavior/issues/32","labels_url":"https://api.github.com/repos/softlayer/sl-ember-behavior/issues/32/labels{/name}","comments_url":"https://api.github.com/repos/softlayer/sl-ember-behavior/issues/32/comments","events_url":"https://api.github.com/repos/softlayer/sl-ember-behavior/issues/32/events","html_url":"https://github.com/softlayer/sl-ember-behavior/issues/32","id":70438195,"number":32,"title":"Allow provider to return simple boolean values instead of functions","user":{"login":"dguettler","id":2046,"avatar_url":"https://avatars.githubusercontent.com/u/2046?v=3","gravatar_id":"","url":"https://api.github.com/users/dguettler","html_url":"https://github.com/dguettler","followers_url":"https://api.github.com/users/dguettler/followers","following_url":"https://api.github.com/users/dguettler/following{/other_user}","gists_url":"https://api.github.com/users/dguettler/gists{/gist_id}","starred_url":"https://api.github.com/users/dguettler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dguettler/subscriptions","organizations_url":"https://api.github.com/users/dguettler/orgs","repos_url":"https://api.github.com/users/dguettler/repos","events_url":"https://api.github.com/users/dguettler/events{/privacy}","received_events_url":"https://api.github.com/users/dguettler/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/softlayer/sl-ember-behavior/labels/2%20-%20Working","name":"2 - Working","color":"CCCCCC"},{"url":"https://api.github.com/repos/softlayer/sl-ember-behavior/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"closed","locked":false,"assignee":{"login":"juwara0","id":8236686,"avatar_url":"https://avatars.githubusercontent.com/u/8236686?v=3","gravatar_id":"","url":"https://api.github.com/users/juwara0","html_url":"https://github.com/juwara0","followers_url":"https://api.github.com/users/juwara0/followers","following_url":"https://api.github.com/users/juwara0/following{/other_user}","gists_url":"https://api.github.com/users/juwara0/gists{/gist_id}","starred_url":"https://api.github.com/users/juwara0/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/juwara0/subscriptions","organizations_url":"https://api.github.com/users/juwara0/orgs","repos_url":"https://api.github.com/users/juwara0/repos","events_url":"https://api.github.com/users/juwara0/events{/privacy}","received_events_url":"https://api.github.com/users/juwara0/received_events","type":"User","site_admin":false},"milestone":null,"comments":1,"created_at":"2015-04-23T15:16:52Z","updated_at":"2015-06-24T12:57:13Z","closed_at":"2015-06-24T12:57:13Z","body":"I found myself in a situation where I would like to have custom behavior for individual providers.\r\nHowever instead of defining a function I would like to return simple booleans. So the behavior data for an individual provider would look like this:\r\n\r\n```\r\n{\r\n  project: true,\r\n  project.edit: false\r\n}\r\n```\r\n\r\nCurrently I accomplish this by overriding the `isAble` function via an initializer. It would be nice to have this option out-of-the-box.\r\n\r\nChanges to the `isAble` function to accomplish this idea:\r\n\r\n```\r\n      var behaviors = this.getWithDefault( 'behaviors', null ),\r\n          isAble    = false,\r\n          behaviorGroup,\r\n          providerIsObject,\r\n          providerBehavior;\r\n\r\n[...]\r\n\r\n      if ( behaviors && behaviors[behaviorGroup] && behaviors[behaviorGroup][behavior] ) {\r\n        providerBehavior = ( providerIsObject  ) ? provider.behaviors[behavior] : true;\r\n\r\n        isAble = ('function' === typeof providerBehavior) ? providerBehavior() : providerBehavior;\r\n      }\r\n\r\n```"}}