import request from '@/utils/request';

export function getAllMenuPermissions(params = {}) {
  return request({
    url: '/backend/allmenupermissions',
    method: 'get',
    params
  });
}

export function getRolePermissions(roleId) {
  return request({
    url: `/backend/rolepermissions/${roleId}`,
    method: 'get'
  });
}

export function assignRolePermissions(roleId, permissions) {
  return request({
    url: `/backend/assignrolepermissions/${roleId}`,
    method: 'post',
    data: { permissions }
  });
}
