예제 #1
0
파일: albums.php 프로젝트: shifter/ospap2
     $objAlbum->set('user_id', $objUser->get('id'));
 }
 if (!$objAlbum->exists('simple_permissions')) {
     $objAlbumGuest = clsAlbum::getPolicyFromRequest('albumpolicy_guest', $objUser);
     $objAlbumGuest->save();
     $objAlbum->set('albumpolicy_guest_id', $objAlbumGuest->get('id'));
     $objAlbumMember = clsAlbum::getPolicyFromRequest('albumpolicy_member', $objUser);
     $objAlbumMember->save();
     $objAlbum->set('albumpolicy_member_id', $objAlbumMember->get('id'));
     $objAlbumGroup = clsAlbum::getPolicyFromRequest('albumpolicy_group', $objUser);
     $objAlbumGroup->save();
     $objAlbum->set('albumpolicy_group_id', $objAlbumGroup->get('id'));
 } else {
     $objAlbumGuest = clsAlbum::getPolicyFromRequest('albumpolicy_guest', $objUser);
     $objAlbumMember = clsAlbum::getPolicyFromRequest('albumpolicy_member', $objUser);
     $objAlbumGroup = clsAlbum::getPolicyFromRequest('albumpolicy_group', $objUser);
     switch ($objAlbum->get('simple_permissions')) {
         /* -1=>"Don't change" */
         case -1:
             /* Do nothing. */
             break;
         case 0:
             /* 0=>"Use same permission as parent",*/
             $objAlbumGroup->set('allow_post_picture', INHERIT);
             $objAlbumGroup->set('allow_post_comment', INHERIT);
             $objAlbumGroup->set('allow_rate', INHERIT);
             $objAlbumGroup->set('allow_view', INHERIT);
             $objAlbumGroup->set('allow_delete_picture', INHERIT);
             $objAlbumGroup->set('allow_create_subalbum', INHERIT);
             $objAlbumMember->set('allow_post_picture', INHERIT);
             $objAlbumMember->set('allow_post_comment', INHERIT);