/**
 * Created by DennysO on 6/27/2015.
 */
var Roles = {};

var notifyRolesComponents = function(id) {
    ////console.log(id);
    $(RolesEntity).trigger(id);
};

var RolesEntity = {
    doneLoading: false,
    get: function() {
        return Roles;
    },
    all: function() {
        var loadRequest = $.ajax({
            type: 'GET',
            url: "/api/getAll/roles",
            dataType: "json"
        });
        loadRequest.done(function(dataFromServer) {
            Roles = dataFromServer;
            notifyRolesComponents('GetAllRoles');
        });
    },
};