Änderung: Anpassung der Berechtigungsverwaltung in ForumService und ForumAdminView
Änderungen: - Im ForumService wurde die Berechtigungsabfrage aktualisiert, um direkt den Wert der Berechtigung zu verwenden. - In ForumAdminView wurde die Verarbeitung der Berechtigungen beim Erstellen eines neuen Forums angepasst, um die Werte der Berechtigungen korrekt zu übermitteln. Diese Anpassungen verbessern die Konsistenz und Funktionalität der Berechtigungsverwaltung im Forum.
This commit is contained in:
@@ -24,7 +24,7 @@ class ForumService extends BaseService {
|
|||||||
if (permissions && permissions.length > 0) {
|
if (permissions && permissions.length > 0) {
|
||||||
for (const permission of permissions) {
|
for (const permission of permissions) {
|
||||||
const forumPermission = await ForumPermission.findOne({
|
const forumPermission = await ForumPermission.findOne({
|
||||||
where: { name: permission.value }
|
where: { name: permission }
|
||||||
});
|
});
|
||||||
if (forumPermission) {
|
if (forumPermission) {
|
||||||
await newForum.addAssociatedPermissions(forumPermission);
|
await newForum.addAssociatedPermissions(forumPermission);
|
||||||
|
|||||||
@@ -86,7 +86,7 @@ export default {
|
|||||||
try {
|
try {
|
||||||
await apiClient.post('/api/forum', {
|
await apiClient.post('/api/forum', {
|
||||||
name: this.newForum.name,
|
name: this.newForum.name,
|
||||||
permissions: this.newForum.permissions,
|
permissions: this.newForum.permissions.map(p => p.value),
|
||||||
});
|
});
|
||||||
this.newForum.name = '';
|
this.newForum.name = '';
|
||||||
this.newForum.permissions = [];
|
this.newForum.permissions = [];
|
||||||
|
|||||||
Reference in New Issue
Block a user