@@ 96-105 (lines=10) @@ | ||
93 | * |
|
94 | * @throws Exception |
|
95 | */ |
|
96 | private function createRole() |
|
97 | { |
|
98 | $model = new AuthItemModel(); |
|
99 | $model->type = Item::TYPE_ROLE; |
|
100 | $model->name = $this->_roleName; |
|
101 | ||
102 | if (!$model->save()) { |
|
103 | throw new Exception("A Role '{$this->_roleName}' has not been created."); |
|
104 | } |
|
105 | } |
|
106 | ||
107 | /** |
|
108 | * Create permission for testing purposes |
|
@@ 112-121 (lines=10) @@ | ||
109 | * |
|
110 | * @throws Exception |
|
111 | */ |
|
112 | private function createPermission() |
|
113 | { |
|
114 | $model = new AuthItemModel(); |
|
115 | $model->type = Item::TYPE_ROLE; |
|
116 | $model->name = $this->_permissionName; |
|
117 | ||
118 | if (!$model->save()) { |
|
119 | throw new Exception("A Permission '{$this->_permissionName}' has not been created."); |
|
120 | } |
|
121 | } |
|
122 | } |
|
123 |