Add membership fee system with disability discount and fix document permissions
Features: - Implement two fee types: entrance fee and annual fee (both NT$1,000) - Add 50% discount for disability certificate holders - Add disability certificate upload in member profile - Integrate disability verification into cashier approval workflow - Add membership fee settings in system admin Document permissions: - Fix hard-coded role logic in Document model - Use permission-based authorization instead of role checks Additional features: - Add announcements, general ledger, and trial balance modules - Add income management and accounting entries - Add comprehensive test suite with factories - Update UI translations to Traditional Chinese 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -196,7 +196,7 @@ class IssueController extends Controller
|
||||
|
||||
public function edit(Issue $issue)
|
||||
{
|
||||
if ($issue->isClosed() && !Auth::user()->is_admin) {
|
||||
if ($issue->isClosed() && !Auth::user()->hasRole('admin')) {
|
||||
return redirect()->route('admin.issues.show', $issue)
|
||||
->with('error', __('Cannot edit closed issues.'));
|
||||
}
|
||||
@@ -211,7 +211,7 @@ class IssueController extends Controller
|
||||
|
||||
public function update(Request $request, Issue $issue)
|
||||
{
|
||||
if ($issue->isClosed() && !Auth::user()->is_admin) {
|
||||
if ($issue->isClosed() && !Auth::user()->hasRole('admin')) {
|
||||
return redirect()->route('admin.issues.show', $issue)
|
||||
->with('error', __('Cannot edit closed issues.'));
|
||||
}
|
||||
@@ -262,7 +262,7 @@ class IssueController extends Controller
|
||||
|
||||
public function destroy(Issue $issue)
|
||||
{
|
||||
if (!Auth::user()->is_admin) {
|
||||
if (!Auth::user()->hasRole('admin')) {
|
||||
abort(403, 'Only administrators can delete issues.');
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user