import request from '@/utils/request';

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

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

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