Below is the code:

```
function addMethods(statusId) {
    var methods = {};
    if (typeof currentUser !== 'undefined') {
        if (currentUser.isAdmin) {
            switch(statusId) {
                case "A":
                    methods.deactivate = true;
                    methods.delete = true;
                    methods.edit = true;
                    break;
                case "P":
                    methods.activate = true;
                    methods.deactivate = true;
                    methods.delete = true;
                    methods.edit = true;
                    break;
                case "D":
                    methods.activate = true;
                    methods.deactivate = true;
                    break;
                case "I":
                    methods.activate = true;
                    methods.delete = true;
                    break;
                default:
                    break;
            }
        } else if (currentUser.userBelongsToCompany) {
            switch(statusId) {
                case "A":
                    methods.deactivate = true;
                    break;
                case "P":
                    methods.activate = true;
                    methods.deactivate = true;
                    methods.edit = true;
                    break;
                case "I":
                    methods.activate = true;
                    break;
                default:
                    break;
            }
        }
    }

    return methods;
}

```

The error: 

```
SCRIPT1010: Expected identifier 

```

Strangely, the error is thrown when it tried to update methods.delete:

```
function addMethods(statusId) {
    var methods = {};
    if (typeof currentUser !== 'undefined') {
        if (currentUser.isAdmin) {
            switch(statusId) {
                case "A":
                    methods.deactivate = true;
                    methods.delete = true;

```