Logo white

Administrator / test_3

Sign in
  • Sign in
  • Project
  • Files
  • Commits
  • Network
  • Graphs
  • Milestones
  • Issues 0
  • Merge Requests 0
  • Labels
  • Wiki
  • test_3
  • common
  • components
  • rules
  • CommentOwnRule.php
  • Commit
    76627175
    Yarik authored
    2016-06-16 16:24:45 +0300  
    Browse Code ยป
CommentOwnRule.php 331 Bytes
Edit Raw Blame History
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
<?php

    namespace common\components\rules;

    use yii\rbac\Rule;

    class CommentOwnRule extends Rule
    {

        public $name = 'canCommentOwn';

        public function execute($user, $item, $params)
        {
            return isset( $params[ 'item' ] ) ? $params[ 'item' ]->user_id == $user : false;
        }

    }