ZABBIX BUGS AND ISSUES
  1. ZABBIX BUGS AND ISSUES
  2. ZBX-4273

getting permission error while creating an action

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.8.8
    • Fix Version/s: None
    • Component/s: API (A)
    • Labels:
    • Environment:
      SLES 11 SP1

      Description

      While trying to create an action on a trigger getting

      Response: {"jsonrpc"=>"2.0", "error"=>

      {"code"=>-32500, "message"=>"Application error.", "data"=>"[ CAction::create ] No permissions !"}

      , "id"=>66484}

      error, unless the user is super admin.

      This happens because of an error in check_permission_for_action_conditions function in the frontends/php/include/actions.inc.php file. The check says "switch($ac_data['type'])" there, but the right name for this param according to api description and the rest of the source is "conditiontype".

      The workaroud is to set both "type" and "conditiontype" vars to contain the same value.

        Activity

        Hide
        Alexander Sorokin added a comment -

        Can not create action at all. In Zabbix manual i see example - 80 lines without any comments.
        Can You show a working example?

        Show
        Alexander Sorokin added a comment - Can not create action at all. In Zabbix manual i see example - 80 lines without any comments. Can You show a working example?
        Hide
        Alexander Sorokin added a comment -

        Working example (change values and remove comments):
        [
        {
        "name": "ZABBIX ACTIO12",
        "eventsource": "0",
        "evaltype": "0",
        "status": "1",
        "esc_period": "3600",
        "def_shortdata": "

        {TRIGGER.NAME}: {STATUS}",
        "def_longdata": "{TRIGGER.NAME}

        :

        {STATUS}",
        "recovery_msg": "0",
        "r_shortdata": "{TRIGGER.NAME}: {STATUS}

        ",
        "r_longdata": "

        {TRIGGER.NAME}: {STATUS}",
        "conditions": [
        { "conditiontype": "3", "operator": "2", "value": "TEST" },
        { "conditiontype": "1", "operator": "1", //HOST ID "value": "10048" }
        ],
        "operations": [
        {
        "operationtype": "0",
        "object": "0",
        //USER ID
        "objectid": "4",
        "shortdata": "{TRIGGER.NAME}

        :

        {STATUS}",
        "longdata": "{TRIGGER.NAME}: {STATUS}

        ",
        "esc_period": "0",
        "esc_step_from": "1",
        "esc_step_to": "1",
        "default_msg": "1",
        "evaltype": "0",
        "opconditions": [],
        "opmediatypes": []
        }
        ]
        }
        ]

        Show
        Alexander Sorokin added a comment - Working example (change values and remove comments): [ { "name": "ZABBIX ACTIO12", "eventsource": "0", "evaltype": "0", "status": "1", "esc_period": "3600", "def_shortdata": " {TRIGGER.NAME}: {STATUS}", "def_longdata": "{TRIGGER.NAME} : {STATUS}", "recovery_msg": "0", "r_shortdata": "{TRIGGER.NAME}: {STATUS} ", "r_longdata": " {TRIGGER.NAME}: {STATUS}", "conditions": [ { "conditiontype": "3", "operator": "2", "value": "TEST" }, { "conditiontype": "1", "operator": "1", //HOST ID "value": "10048" } ], "operations": [ { "operationtype": "0", "object": "0", //USER ID "objectid": "4", "shortdata": "{TRIGGER.NAME} : {STATUS}", "longdata": "{TRIGGER.NAME}: {STATUS} ", "esc_period": "0", "esc_step_from": "1", "esc_step_to": "1", "default_msg": "1", "evaltype": "0", "opconditions": [], "opmediatypes": [] } ] } ]
        Hide
        Alexander Sorokin added a comment -

        Fixed in development branch svn://svn.zabbix.com/branches/dev/ZBX-4273

        Show
        Alexander Sorokin added a comment - Fixed in development branch svn://svn.zabbix.com/branches/dev/ZBX-4273
        Hide
        Alexander Sorokin added a comment -

        Fixed in 1.8.10rc1

        Show
        Alexander Sorokin added a comment - Fixed in 1.8.10rc1
        Hide
        richlv added a comment - - edited

        (1) changelog entry has not been added to the trunk changelog

        <sanja> RESOLVED

        Show
        richlv added a comment - - edited (1) changelog entry has not been added to the trunk changelog <sanja> RESOLVED

          People

          • Assignee:
            Alexander Sorokin
            Reporter:
            Sergey Alexandrov
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: