@@ 284-310 (lines=27) @@ | ||
281 | * |
|
282 | * @return mixed |
|
283 | */ |
|
284 | public function addPermissionToGroup( $permission, $group ) |
|
285 | { |
|
286 | $permission_id = $this->getPermissionID($permission); |
|
287 | $group_id = $this->getGroupID($group); |
|
288 | ||
289 | // Permission ID |
|
290 | if ( ! is_numeric( $permission_id ) ) |
|
291 | { |
|
292 | return false; |
|
293 | } |
|
294 | ||
295 | // Group ID |
|
296 | if ( ! is_numeric( $group_id ) ) |
|
297 | { |
|
298 | return false; |
|
299 | } |
|
300 | ||
301 | // Remove it! |
|
302 | if ( ! $this->groupModel->addPermissionToGroup( $permission_id, $group_id ) ) |
|
303 | { |
|
304 | $this->error = $this->groupModel->error(); |
|
305 | ||
306 | return FALSE; |
|
307 | } |
|
308 | ||
309 | return TRUE; |
|
310 | } |
|
311 | ||
312 | //-------------------------------------------------------------------- |
|
313 | ||
@@ 322-348 (lines=27) @@ | ||
319 | * |
|
320 | * @return mixed |
|
321 | */ |
|
322 | public function removePermissionFromGroup( $permission, $group ) |
|
323 | { |
|
324 | $permission_id = $this->getPermissionID($permission); |
|
325 | $group_id = $this->getGroupID($group); |
|
326 | ||
327 | // Permission ID |
|
328 | if ( ! is_numeric( $permission_id ) ) |
|
329 | { |
|
330 | return false; |
|
331 | } |
|
332 | ||
333 | // Group ID |
|
334 | if ( ! is_numeric( $group_id ) ) |
|
335 | { |
|
336 | return false; |
|
337 | } |
|
338 | ||
339 | // Remove it! |
|
340 | if ( ! $this->groupModel->removePermissionFromGroup( $permission_id, $group_id ) ) |
|
341 | { |
|
342 | $this->error = $this->groupModel->error(); |
|
343 | ||
344 | return FALSE; |
|
345 | } |
|
346 | ||
347 | return TRUE; |
|
348 | } |
|
349 | ||
350 | //-------------------------------------------------------------------- |
|
351 |